FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

C++ Strings

 


thnn
How do you set a string in C++ i cant get string option; to work.
Mongrel
what exactly are you trying to do?
raver
Youmust use the string.h class . Check it out here:
http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html
Naif
An string object or an array?

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.
thnn
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.
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.