Hi Guys!
Im new to c++ but have made a few programs. I am currently making a memory testing game. it was all working well untill i started using an array to generate random numbers. if the code is too dificult to understand i'll anotate it but other than that can anyone help me?
here is the code:
it's not finnished yet but im getting these errors:Code:#include <cstdlib> #include <iostream> #include <dos.h> #include <windows.h> #include <stdlib.h> #include <conio.h> using namespace std; int main() { int numberarray[20]; int numberarrayplace; cout<<"Welcome to Dave's memory lab! \n"; cout<<"Here we will carry out a test: \n"; cout<<"Remember the numbers!"; cout<<"You will be given 20 numbers from 0 to 100 and you have 30 seconds to memorize them \n"; cout<<"Then you will be tested... \n"; Sleep(1000); cout<<"3 \n"; Sleep(1000); cout<<"2 \n"; Sleep(1000); cout<<"1 \n"; Sleep(1000); system("cls"); numberarray = 1; for ( 1 == 1 ) { numberarray[numberarrayplace] = rand(100); cout<< numberarray[numberarrayplace] << " "; } cout<<"Here are your numbers \n"; Sleep(30000); cout<<"Times up! \n"; }
C:\Dev-Cpp\Projects\Fun Projects\Memory Chalenge\main.cpp In function `int main()':
29 C:\Dev-Cpp\Projects\Fun Projects\Memory Chalenge\main.cpp incompatible types in assignment of `int' to `int[20]'
30 C:\Dev-Cpp\Projects\Fun Projects\Memory Chalenge\main.cpp expected `;' before ')' token
35 C:\Dev-Cpp\Projects\Fun Projects\Memory Chalenge\main.cpp expected `)' before ';' token
C:\Dev-Cpp\Projects\Fun Projects\Memory Chalenge\Makefile.win [Build Error] [main.o] Error 1
i apreciate your help.
Gillypie