I'm trying to assign a value to a string.....without luck....
fx.
char mystring[40];
mystring ="Something";
What is wrong....????
Printable View
I'm trying to assign a value to a string.....without luck....
fx.
char mystring[40];
mystring ="Something";
What is wrong....????
This Works:
Code:char mystring[] = "Something";
Yes, but what if I want to change the string later on in the program????
Code:strcpy(String, "Hello");
Code:#include <string,h>
int main()
{
char mystr[40];
strcpy(mystr, "The String");
return 0;
}