this does not work and this does
int main()
{
char floor[20][20];
for(int c=0;c<20;c++)
{
for(int r=0;r<20;r++)
{
std:: cout<<floor[r][c];
}
std:: cout<<std::endl;
}
Does this work on your compiler i get an error:
Error 1 error C2365: 'floor' : redefinition; previous definition was 'function'
Error 2: error C2563: mismatch in formal parameter list
In g++ it gives no errors however it doesn't display anything, it just creates a big space with whitespace which is normal since the arrays isn't defined.
What compiler are you using? Visual Studio? If so which version?
EDIT: Try removing getch(); and substitute it for std::cin.ignore();
However, floor() is in the header <cmath>, the C++ equivalent of the C header <math.h>.
For such headers, an implementation is allowed to first declare the name in the global unnamed namespace scope (just as C does) and then inject the name into the std namespace with a using ::floor ;.