problem with loops

As of I know increment operator increases the value by 1, so does variable+1.
but in this homework problem when i'm using increment operator the loop is working fine. but when i use +1, it starts an infinite loop. why so? i'm using Visual C++ 2010.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  int main()
{
	int b=10;
for (int r=1; r<=5; r++)
{
for(int space=1; space<b; space++)
{
	cout<<" ";
}

for(int c=0; c<2*r-1; c++) /*here when i use c+1 instead of c++, it starts an infinite loop. */
{
	cout<<"*";

}
b--;
cout<<endl;


}

return 0;
} 
It should be c = c+1.
c+1 on its own does nothing.
okay i'm an idiot. thanks it worked :P
Topic archived. No new replies allowed.