How do you set a string in C++ i cant get string option; to work.
C++ Strings
what exactly are you trying to do?
Youmust use the string.h class . Check it out here:
http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html
http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html
An string object or an array?
For an array:
For an object of type String
Hope this helps.
For an array:
| Code: |
|
char stringArr[30]; // 30 is the size here strcpy(stringArr, "Your string"); // strcpy is the function used to copy a // string, make sure to include <string.h> In C/C++, you can just do stringArr = "Your string" |
For an object of type String
| Code: |
|
String str = "Your string"; str = "New string"; |
Hope this helps.
I relised in my if statement that I hadnt used "test value" i was using 'test value' and that was my problem. I have fixed it now.
