1: How do you define multi-dimensional arrays? I thought it was like this:
1 2 3
int array[3][3]={1,2,3}
{4,5,6}
{7,8,9};
but that gives me an error where it says it needs a semicolon before the next braces.
2. How do you clear the screen without using system()?
3. Is it possible to get Windows message boxes into a console application if I include windows.h?
4. What are the ASCII values for the different arrow keys? Or if you could give me a link to a place where I could find all of them, I would appreciate it. (or if I can operate with windows and use the message loop, please tell me.)
5. If I am including .cpp files in a main project and not actually compiling them as stand-alone programs, do I need them to have a main() function?
3) I mean that I am compiling a console application, and I want it to have message boxes that pop up when the user left clicks, right clicks, or breaks the program's rules. The program I am writing really needs to be a console app, though, because the number of renders that would be required would murder my poor netbook.
3) I mean that I am compiling a console application, and I want it to have message boxes that pop up when the user left clicks, right clicks, or breaks the program's rules. The program I am writing really needs to be a console app, though, because the number of renders that would be required would murder my poor netbook.
as far as i know (and as far as i understand your question), yes. simply use the windows.h header, and you can use MessageBox()
1) You have to separate the numbers enclosed in {}s using ","s too:
1 2 3 4 5
int Example[3][3]={
{3,1,2},
{8,7,9},
{6,5,4},
}
2) The most simple ways are clrscr() from conio.h, and the standard system("cls") (wich is bad, but i still use it because clrscr does'nt works for me...).
3)What chipp said before, MessageBox().
4)For Windows: Up arrow key: 72 Down arrow key: 80 Right arrow key: 77 Left arrow key: 75 Enter key: 13 Backspace key: 8