d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > C++ Returning A String > String Is Empty After I Return It?
Prev12
Add Reply New Topic New Poll
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 25 2013 08:56pm
Quote (DARK_SPAWN @ Mar 25 2013 10:40pm)
haven't learned that one yet.

I managed to fix the issue and not just copying each if statements again for each letter and number haha.
How could i take the char a and b and put them pack into a string? but their gonna be numbers.


if this is C++ i would look at using the .c_str() method and the and to convert it back just initialize the string with the cstring modified value

Code
string lol = "whats this???";

char cstr[100] = lol.c_str();

//modify cstr

lol = cstr;


its a bit of a round about method of doing this seeing how you can do everything you need with a c string.

Code
char str[100] = {0};

cin << str;

//work with your string

cout >> str << endl;
Member
Posts: 27,086
Joined: Mar 7 2008
Gold: 685.00
Mar 25 2013 09:34pm
Quote (AbDuCt @ 25 Mar 2013 21:38)
why not just use a toupper() function before parsing your characters


this
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll