I was trying to make a program that simulates a cardgame, but I run on to something at the very start. I wasn't able to figure out what I or it was doing wrong, since it doesn't run it at all. No error, no bleeps, no blank screens. Nothing. Just a flash.
#include <iostream.h>
int main()
{
int a;
char clr[5] = {'o','h','d','s','c'};
char nmr[10] = {'0','A','J','Q','K','@','#','7','8','9'};
cout << "The Jack of Spades (3;2) is abbreviated: " << clr[3] << "" << nmr[2];
cout << "How Awesome...";
cin.get();
return 0;
}
This is not an extract, this is in fact the whole code. That's what bothers me about it.
I know I could use "ohdsc" instead, but that shouldn't mather, right? Also, clr[5] has 5 variables, clr[0]-clr[4], so that should work as well.
Maybe it thinks I want to define nmr[5] instead of the whole nmr range, but I don't know how else to define it. I almost copied it from the book I'm working with, so what is happening?
I'm running it with Dev-C++ and Vista.