I am trying to draw a hollow square and I am having a problem with nesting while loops within while loops. Is this possible?
The quoted part of code is the trouble part.
#include <iostream>
using namespace std;
int main(void)
{
int sides, t=2, h=0, b=0, s;
cout<<"Size of square: \n";
cin>> sides;
s=sides-2;
cout<< "\n" ;
cout<< s <<endl;
system("PAUSE");
do {
cout<< "*" ;
{for (;s!= 0;--s)
cout<< " " ;
cout<< "*" ;}
++h;
}while (h<sides);
cout<< "\n" ;
cout<< "\n" ;
system("PAUSE");
return 0;
}