New Member
💻 Oldtimer
I need a little help here. I'm a pretty n00b programmer taking a class in highschool (it's a crappy class cuz the books are old, we use CODEWARRIOR, we use macs - nuff said)
Anyways I started to work on a program of my own and I would like to get some kind of conditional statement that would be something like...
if (Class == "Monk").... blah blah, I tried it and it didn't work...anyways here's my program so far (I've been experimenting w/ stuff) The book for C++ we use talks alot about Strings using #'s and single characters but nothing like im trying to do! >.<
Anyways I started to work on a program of my own and I would like to get some kind of conditional statement that would be something like...
if (Class == "Monk").... blah blah, I tried it and it didn't work...anyways here's my program so far (I've been experimenting w/ stuff) The book for C++ we use talks alot about Strings using #'s and single characters but nothing like im trying to do! >.<
Code:
// Sean Kiles
// DA
// 324
// Refer To fig04_16.cpp
#include <York.h>
void classHandling( char * );
char CName[ 12 ], Class[ 7 ];
int STR, INT, WIS, CON, DEX, Insight;
int main()
{
cout << "DDDDDDD" << endl;
cout << "D D k k" << endl;
cout << "D D k k" << endl;
cout << "D D a a rrr kk" << endl;
cout << "D D a a r k k" << endl;
cout << "DDDDDDD a a a r k k" << endl;
SKIP_2;
cout << "\t" << " A" << endl;
cout << "\t" << " A A" << endl;
cout << "\t" << " A A" << endl;
cout << "\t" << " AAAAAAA g g eee sss" << endl;
cout << "\t" << " A A g g eeeee s s" << endl;
cout << "\t" << " A A g gg e s" << endl;
cout << "\t" << "A A g eeee sss" << endl;
cout << "\t" << " ggg" << endl;
SKIP_4;
cout << "[ Enter The Following Information ]\n" << endl;
cout << "CHARACTER NAME\n> ";
// cin >> set( 12 ) >> CName;
cin.getline(CName, 12, '\n');
cout << "CLASS (Monk, Priest, Rogue, Warrior, Wizard)\n> ";
// cin >> set( 7 ) >> Class;
cin.getline(Class, 7, '\n');
cout << "INSIGHT (1-99, 100 for Master)\n> ";
cin >> setw( 3 ) >> Insight;
cout << "STATS\n";
cout << "\tStr> ";
cin >> setw( 3 ) >> STR;
cout << "\tInt> ";
cin >> setw( 3 ) >> INT;
cout << "\tWis> ";
cin >> setw( 3 ) >> WIS;
cout << "\tCon> ";
cin >> setw( 3 ) >> CON;
cout << "\tDex> ";
cin >> setw( 3 ) >> DEX;
classHandling( Class );
return 0;
}
void classHandling( char *classPtr )
{
for ( ; *classPtr != 'Monk'; classPtr++) {
cout << CName << "\n" << *classPtr << "\n" << Insight << endl;
}
}