what's wrong with this code? i can't create a triangle..
int rows = 10;
double cols = rows*1.5;
string s = " ";
string::size_type space = s.size();
for (int r = 0; r != rows; ++r)
{ string::size_type c = 0;
while (c != cols)
{ if (c == space - 1)
{cout<< "*";
c += space; }
else
{ if (r == rows - 1 || c == 0)
cout<< "*";
else
cout<< " ";
++c;}}
cout<<endl;}- [c-prog] triangle jay-r
- Re: [c-prog] triangle John Gaughan
- Re: [c-prog] triangle Paul Herring
- Re: [c-prog] triangle John Gaughan
- [c-prog] Re: triangle jay-r
- Re: [c-prog] Re: triangle Thomas Hruska
- Re: [c-prog] Re: triangle John Gaughan
- Re: [c-prog] code presentation (was: triangle) Jim Dougherty
- Re: [c-prog] code presentation (was: triangle) andrew clarke
- [c-prog] Re: code presentation (was: triangle) John Matthews
- [c-prog] Re: code presentation (was: trian... John Matthews
