FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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.
Related topics
Command and Conquer
Funny C variable
[php scripts ] phpweather&email
What can I do with C-Panel?
pay attition to the new virus Backdoor.Nibu.K
HELP ME in C++
Languages in c++
C++ TUTORIAL : INTRODUCTION TO C++
I searching for a site
Image Processing in C++ by Shirish
C en C++
C# tutorials
C en C++
Guitar Thread: 7 Strings Guitars (or possibly more)
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-2011 Frihost, forums powered by phpBB.