Simple question,
Is there a way to convert a string
to char* or char [255]
either will work for me.
I did a google search but to much junk to sort
through came up and nothing that really helped!
All replies are appreicated, and thanks in advance!
Ex.
Code:
string mystring = "Hello World!";
converted to : (but the below does not work)
Code:
char * mychars = mystring;
or
char mychars[255] = mystring;
I even went as far as to use a for loop to copy each individual
character from the string, but that didnt always prove successful
i need a surefire way!
I also tried strcpy() but it only seems to copy
char* to char* or string to string, not string to char*