Tuesday, 13 August 2013

How to convert a char* to a char[]

How to convert a char* to a char[]

I was wondering if there was a way to convert a string that has its first
letter pointed at by a char* to a char[], so it is no longer a pointer,
but a literal char[].
For example, if my string is "hi my name is bob\0", and char* pointer had
this string copied to it via memcpy, is there a way to turn this back to a
char[]?
Any help would be appreciated.

No comments:

Post a Comment