Author |
Message |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
|
Back to top |
|
 |
Cheese Wow Cheese is so helpful!

Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Wed Oct 29, 2008 12:29 am Post subject: |
 |
|
|
|
1st glance,
player->name instead of
player->player->name?
or perhaps you cant strcat strings with +...
your compiler wouldnt allow it
like A + E != AE _________________ SSC Distension Owner
SSCU Trench Wars Developer |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Oct 29, 2008 12:41 am Post subject: |
 |
|
|
|
I'm using MSVC 6.0.. And player->Name doesn't exist. |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Wed Oct 29, 2008 1:07 am Post subject: |
 |
|
|
|
You can't use += with a char array...
Nothing to do with the compiler, but more with the language itself.
It works in MervBot when you use the String class, but it never works with char[]
You need to use strcat(char *, char *)
google some for help on it. But basically, one of the arguments is const, which is the string you want appended, and the other one is the string to which you want to append stuff
strcat(s, player->player->Name);
or something like that _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Oct 29, 2008 1:17 am Post subject: |
 |
|
|
|
So pretty much, just make the whole string strcat?
EDIT: There's no other way to do it? |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Oct 29, 2008 6:12 am Post subject: |
 |
|
|
|
Contempt+ wrote: | EDIT: There's no other way to do it? |
It's C++, there's a billion ways to do anything. Using strcat is just the most direct. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Oct 29, 2008 12:44 pm Post subject: |
 |
|
|
|
Hmm, I'm a newbie with coding. Anyone have a link or a reference I can look at so I can implement it? |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Wed Oct 29, 2008 1:10 pm Post subject: |
 |
|
|
|
http://en.wikipedia.org/wiki/Strcat
Quote: | The name strcat is an abbreviation of "string concatenate". strcat is found in the string.h header file. | Make sure to include it |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Oct 29, 2008 1:28 pm Post subject: |
 |
|
|
|
Well, the biller uses strings all throughout the src, so string.h is in the header.
Only problem is, my dumb ass can't figure it out haha. |
|
Back to top |
|
 |
|