Saturday, 29 April 2006
C assignment problem and explanation
Question:
<Insert some problem description of something not working>
The value refers to the invalid using of "*(array)++;"
However, if i follow the lab05 exercise, which was using "*array++", it didn't prompt the above error but i can't increment the array's value.
Answer:
*(array)++;
is equivalent to:
*((array)++);
which is kinda equivalent to:
*pointer;
Which is sorta equivalent to:
42;
Which doesn't do anything :) br>
<Insert some problem description of something not working>
The value refers to the invalid using of "*(array)++;"
However, if i follow the lab05 exercise, which was using "*array++", it didn't prompt the above error but i can't increment the array's value.
Answer:
*(array)++;
is equivalent to:
*((array)++);
which is kinda equivalent to:
*pointer;
Which is sorta equivalent to:
42;
Which doesn't do anything :) br>