View Single Post
  #2 (permalink)  
Old 12-06-2007, 12:01 PM
Bench Bench is offline
Full Programmer
Join Date: Jul 2007
Location: UK
Posts: 116
iTrader: (0)
Bench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished road
C is a far pickier language than C++. strictly speaking in C, this line is illegal
Code:
for (int i = 0; i < n; i++)
There's a chance that your version of GCC will let you get away with it, but in C, all declarations must come before any code - which means the int i = 0 portion of that for statement needs to change to i = 0 with your int i; being declared at the top of main()

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote