Can somebody please tell me why the first code works and second not (of course the only difference is changing type of i var. from int to unsigned int) and maybe evaulate a solution how to change a first code using unsigned type and not receive an error.
Regards, Martin
(OS and comp.)
using Linux and gcc
Code:
int a[3];
a[0]=0; a[1]=1; a[2]=2;
unsigned int i=0;
for(i=2;i>=0;i--)
cout<<a[i]<<endl;
Code:
int a[3];
a[0]=0; a[1]=1; a[2]=2;
int i=0;
for(i=2;i>=0;i--)
cout<<a[i]<<endl;
Regards, Martin
(OS and comp.)
using Linux and gcc