arrays and char.

Pages: 12
Does the program break / stop (on your computer) when you enter a letter? And not just keep asking for a number? Because i just copied the whole thing again and put it in CodeBlocks and same thing.

In case it does, something must be wrong on my computer, but thanks for taking the time to help :)
Last edited on
"Can it be because
cin >> array[i], charcheck;

cin >> integer, char in same statement?"

That should not matter. If you want, you can try doing
1
2
cin >> array[i]; 
array[i] = charcheck;
and see if that fixes it but I doubt that it will.

"Does the program break / stop (on your computer) when you enter a letter? And not just keep asking for a number? "

Yes it stops the program and does not ask for any more numbers (rather, it technically just stops the for statement). However, it doesn't print the array, but that's another problem I'd have to deal with (easily fixable).
Last edited on
It says "Right hand operand of comma has no effect", but the program doesn't work the same way in Eclipse as it does in CodeBlocks even though it doesn't work as i wanted it to.

Anyway, goodnight and thanks again, hehe.
Last edited on
It's saying cin >> array[i], charcheck; isn't valid. I must be using the wrong syntax. I thought that worked.

Whatever. I'm tired lol. I tried :)

Edit: Oh duh, it's probably cin >> array[i] >> charcheck;
Damn, try that.

Nope, nevermind. That's wrong.
Last edited on
Topic archived. No new replies allowed.
Pages: 12