I am trying to compile a program written in C on visual studio c++ 2010. I created a new project and placed all the .c files and h files into a new project. As have read from other sources, I selected the option of 'not using precompiled headers' from the properties window of each .c file. I also selected 'compile as C code' from the advanced window on the properties window. When I compile I keep getting the following errors which seem to correspond to lines 11 and 12 of the code which is shown below:
int i = 0;
while ( i < database_pt->number_of_tracks )
{
//printf("Deleting track %d ... \n", i );
delete_track (&(database_pt->tracks_pt[i]));
i ++;
}
The last line here, with the incrementation, is probably the source of one or both errors. You have a space between the 'i' and the "++".
MS VC++ 2010 does support the C99 Standard. This means that all variables you should declare in the very beginning of a block. So, for example, your definition of variable i in the middle of the function body