![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
|
Re: multiple values for one char
Indeed there is, im not thinking straight as im falling asleep but anyway you could use something like this.
C++ Syntax (Toggle Plain Text)
Something like that is what your after, there are probably better ways but i cannot thing straight right now, im gonna shoot off anyway so if you need it explaining then im sure one of the other guys will help. If not i will when im next online. I recomment reading up on cctype as this will help you understand what is going on, also you should be aware that you are able to treat strings as char arrays, these will help you understand this. C++ Syntax (Toggle Plain Text)
Cheers, Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#12 |
|
Newbie
Join Date: Nov 2007
Location: Central USA
Posts: 12
Rep Power: 0
![]() |
Re: multiple values for one char
I have been messing around some more with the for statement i have a question that has 5 possible answers and do this statement
c++ Syntax (Toggle Plain Text)
then i compile it with g++ and it brings up with error k.cpp: In function ‘int main()’: k.cpp:19: error: expected primary-expression before ‘else’ k.cpp:19: error: expected `;' before ‘else’ i cant figure out where to put or take away the ; ?? |
|
|
|
|
|
#13 |
|
Hobbyist Programmer
|
Re: multiple values for one char
C++ Syntax (Toggle Plain Text)
it was just down to bracket placement, i think this will work im sort of busy at the same time so if theres a mistake just let me know. you had placed the else statement outside of the for loop. Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#14 |
|
Newbie
Join Date: Nov 2007
Location: Central USA
Posts: 12
Rep Power: 0
![]() |
Re: multiple values for one char
That worked thanks.. i thought i tried that but i guess i didnt. thanks again for the help
|
|
|
|
|
|
#15 |
|
Hobbyist Programmer
|
Re: multiple values for one char
your welcome.
Cheers, Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem processing file into a char array | csrocker101 | C++ | 1 | May 8th, 2007 11:50 PM |
| Convert char[14] to char * | myName | C++ | 1 | Mar 5th, 2006 8:08 PM |
| Setting value to char pointer element.... | tempest | C | 11 | Oct 5th, 2005 3:22 PM |
| Char assignment using Octal values | aznluvsmc | C | 11 | Aug 18th, 2005 5:31 AM |
| Pointers to return multiple values | Clotters | C++ | 8 | Jul 20th, 2005 9:54 PM |