Just host via FileZilla? ;P
I do that sometimes when i need to access home shit from different location. Compliments, marauder. ;P
leave C++ strings. get on the char* boat.
Moderator: Coders of Rage
Re: leave C++ strings. get on the char* boat.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: leave C++ strings. get on the char* boat.
I see what you're saying avansc, but there's really not too much difference between char*'s and strings. And strings are almost MORE flexible.
1) both of them are arrays:
I may be wrong, but this should output:
3) strings have quite a few functions to make it easier to do certain things with a string (see here.
If I'm incorrect at any point, please correct me; I can't say that I'm an expert with either strings or char*'s, I was just putting in my two cents.
1) both of them are arrays:
Code: Select all
char *c_string = "Hi\n"
string cplusplus_string = "Hi\n"
cout << c_string << cplusplus_string;
cout << c_string[0] << cplusplus_string[0]
2) strings let you decide whether you want to pass a char* or a string to a function, if you're passing it to a function. It can also "become" a const char* for things like opening files by using c_str(), but with char*'s I guess you could const_cast it?Hi
Hi
HH
3) strings have quite a few functions to make it easier to do certain things with a string (see here.
If I'm incorrect at any point, please correct me; I can't say that I'm an expert with either strings or char*'s, I was just putting in my two cents.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.