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.
Witchie NL - 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).
Cyan~Fire - 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.
minor59er - Fri Feb 16, 2007 8:22 pm
Post subject:
Ok, since my code that ive tried hasn't worked, and i looked up usign a reinterpret_cast, and my attempt is this..
if (c->check("reg"))
{
playerName[regNum] = reinterpret_cast <char> (p->name);
sendPrivate(p, &playerName[regNum]);
sendPrivate(p, "You have been registerd to play this session.");
regNum++;
}
|
But when i try to call a name from the array it comes out in
"Ã…ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ"
Any ideas on this?
Cyan~Fire - 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
minor59er - Fri Feb 16, 2007 10:14 pm
Post subject:
you don't have to be so rude.
Bak - Fri Feb 16, 2007 10:39 pm
Post subject:
try this:
strcpy(playerName, p->name);
|
Cyan~Fire - Sun Feb 18, 2007 1:05 am
Post subject:
I already suggested it two times, but I'm sorry for being rude.