Author |
Message |
minor59er Newbie
Age:36 Gender: Joined: Dec 14 2002 Posts: 11 Offline
|
|
Back to top |
|
 |
myke Seasoned Helper
Gender: Joined: Sep 11 2003 Posts: 142 Offline
|
Posted: Thu Feb 15, 2007 9:47 am Post subject: |
 |
|
|
|
what i don't understand is why are you trying to change p->name, from what i can see it looks like you're trying to make an array'd list of people who reg for a game.
if that is what you're trying to do, try changing
p->name = playerName[regNum]; |
to
playerName[regNum] = p->name; |
|
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Thu Feb 15, 2007 10:30 am Post subject: |
 |
|
|
|
indeed, p->name is an char[20] array type which cant be initialized in such a way.
however you can change the value of playerName[#] (# is regNum in this case).
so what myke sais is an option. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Feb 15, 2007 10:36 am Post subject: |
 |
|
|
|
Which is why you should actually learn C++ before trying to make bots. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
minor59er Newbie
Age:36 Gender: Joined: Dec 14 2002 Posts: 11 Offline
|
Posted: Thu Feb 15, 2007 9:16 pm Post subject: |
 |
|
|
|
Ah crap... i didn't even notice it... was so tired last night... ahahahaha, im so stupid for that. Thanks for pointing that out for me
And btw i haven't done a course but i spent a few weeks reading "C++ - How To Program, 5th Edition (2005)" so i do have some knowledge.. just didn't realize that i was trying to put an array into a pointer.. |
|
Back to top |
|
 |
Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Thu Feb 15, 2007 9:27 pm Post subject: |
 |
|
|
|
Cyan~Fire wrote: | Which is why you should actually learn C++ before trying to make bots. |
I spent my time reading books and tutorials instead of actually trying to program something, and I regret that, because I still don't know how to program. But I learned 90% of what I know through attempts, not the books I read. |
|
Back to top |
|
 |
Witchie NL Seasoned Helper
Age:35 Gender: Joined: Jul 24 2005 Posts: 112 Location: Veere, Zeeland, Netherlands Offline
|
Posted: Fri Feb 16, 2007 7:57 am Post subject: |
 |
|
|
|
i learned everything i know now by looking at other sources.
I did read a book from the liberary when i started coding but i stoped at chapter 4 of 17, which just where some basics (!, ==, ++, --, -=, +=, %, /, {} etc... not even array and pointers which where chapter 5).
so i had to learn practicly everything from scratch (was a bitch tho). |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Feb 16, 2007 10:27 am Post subject: |
 |
|
|
|
Well, I'm sorry reading didn't work out too well for you guys, but I definitely got my basic C++ knowledge from the tutorial I link all over the place here. Obviously coding is what makes you really understand the stuff, but if you don't get the basics (pointers, etc.) and then come running to a forum when you get a compile error, you're going about it the wrong way. |
|
Back to top |
|
 |
minor59er Newbie
Age:36 Gender: Joined: Dec 14 2002 Posts: 11 Offline
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Feb 16, 2007 8:52 pm Post subject: |
 |
|
|
|
Read a stupid tutorial. You're copying a char, not a char array (string).
Character sequences |
|
Back to top |
|
 |
minor59er Newbie
Age:36 Gender: Joined: Dec 14 2002 Posts: 11 Offline
|
Posted: Fri Feb 16, 2007 10:14 pm Post subject: |
 |
|
|
|
you don't have to be so rude. |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Feb 18, 2007 1:05 am Post subject: |
 |
|
|
|
I already suggested it two times, but I'm sorry for being rude. |
|
Back to top |
|
 |
|