|
-
Jan 11th, 2001, 12:32 PM
#1
Thread Starter
Frenzied Member
I'm trying to assign a value to a string.....without luck....
fx.
char mystring[40];
mystring ="Something";
What is wrong....????
-
Jan 11th, 2001, 01:52 PM
#2
Frenzied Member
This Works:
Code:
char mystring[] = "Something";
-
Jan 11th, 2001, 01:58 PM
#3
Thread Starter
Frenzied Member
Yes, but what if I want to change the string later on in the program????
-
Jan 11th, 2001, 03:16 PM
#4
Code:
strcpy(String, "Hello");
-
Jan 11th, 2001, 03:18 PM
#5
Code:
#include <string,h>
int main()
{
char mystr[40];
strcpy(mystr, "The String");
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|