-
i've already done that ( learn on tutorials, before asking you questions:), and open a good C++ book), but despite that, for now i don't succeed into doing what i want to do, but i'll keep doing my best and i'll quickly stop to ask you such basic questions.
Now i've completed what you sent me, but i get plenty of error stray '...' in program
Here is my code :
Code:
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
void initArray(int largeArray[20][20])
{
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 20; y++)
{
largeArray[x][y] = 0;
}
}
}
void printOutArray(int largeArray[20][20])
{
int x;
int y;
for (int x = 0; x < 20; x++){
for ( y = 0 ; y<20; y++ ){
cout<< largeArray [x] [y]<<'\t' ;
}
cout << endl ;
}
}
int main()
{
int largeArray[20][20];
initArray(largeArray);
printOutArray(largeArray);
system("PAUSE");
}
-
What's wrong in this code please? Why do i have so many error stray '...' in program?
-
That should be fine (it works here).
The only thing I saw was this.
Code:
$ g++ -Wall -Wextra foo.cpp
foo.cpp: In function ‘void printOutArray(int (*)[20])’:
foo.cpp:25:7: warning: unused variable ‘x’ [-Wunused-variable]
> Now i've completed what you sent me, but i get plenty of error stray '...' in program
You typically get that when you just copy/paste code direct from the internet. Especially code which has been "pretty-printed" into HTML with dumb things like ' ' replaced with "smart quotes".
-
Ok now it works : all my "error stray '...' in program" went away when i typed in again in another project the same code exactly ( except for int x and int y in voidprintOutArray that i deleted, and i added the "int" before y that was missing in the loop for in this function). Thank you all !!
Thank you Salem !!