///////////// start code /////////////
#include<iostream>
#include<iomanip>
using namespace std;
int ReadSquareSize()
{
int x;
cout<<"Plhktrologhse to mege8os tou pinaka, akeraios 8etikos perittos apo 3 kai panw: ";
while(1)
{
cin>>x;
if(x>=3 && x%2==1)
{
return x;
}
else
{
cout<<"Plhktrologhse to mege8os tou pinaka, akeraios 8etikos perittos apo 3 kai panw: ";
}
}
cout<<endl;
}
int main()
{
int n = ReadSquareSize();
int square[n][n]; //----- error here -----
}
///////////////// end code /////////////////
This is a part from my code. What i cannot understand is why i get 6 errors in the error line. I have declared n from the previous line. Malloc is better to use? If so, can u post the corrected code lines?