#include
static int count;
int incr( ) {return ++count;}
int main( )
{
int arr[ ]={1, 2, 3, 4};
arr[count++]=incr( );
printf("arr[count]=%d\n", arr[0]);
printf("arr[count]=%d\n", arr[1]);
printf("arr[count]=%d\n", arr[2]);
printf("arr[count]=%d\n", arr[3]);
}

Amit Kumar14 reputationPosted Jun 20, 2010, 11:23 PM EDT
of this program
#include
#include
static int count;
int incr( ) {return ++count;}
int main( )
{
int arr[ ]={1, 2, 3, 4};
arr[count++]=incr( );
printf("arr[count]=%d\n", arr[count]);
Marimuthu ArigovindasamyRank #5,893 · 283 reputationPosted Jun 20, 2010, 11:42 PM EDT
because of this ++ in arr[count++]
count = 1
count value again increasing by "return ++count"
count = 2
arr[2] means 3 (arr[0] = 1, arr[1] = 2)
Amit Kumar14 reputationPosted Jun 21, 2010, 12:05 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Jun 21, 2010, 11:03 AM EDT
What you can also do to get help here is to describe what the program does as best as you can. If you have a specific question then ask about that. Since you are a student, the best help for you is to help you learn; it does not help you if you get all the answers from others.