|
Forums » Education » General »
Posted Date: 05 Jun 2009 Posted By:: Malathi Member Level: Silver Member Rank: 3948 Points: 1
Responses:
3
|
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
|
Responses
|
#88903 Author: Deepakkumar Devarajan Member Level: Gold Member Rank: 0 Date: 05/Jun/2009 Rating:  Points: 2 | Hi Malathi,
It might cause an error , as variable c is not a pointer . i am not sure about it . Please join my community and post the same
http://www.indiastudychannel.com/sites/152280/-Tech-World.aspx
Regards, Deepakkumar D Join My community :
| #88929 Author: Gopal Bhageria Member Level: Bronze Member Rank: 0 Date: 05/Jun/2009 Rating:  Points: 3 | Does not give an error. The answer to this is:- 2222228344 *) c in itself is a pointer to the first element of an array. *) the first loop prints *c without incrementing c itself, hence only 2 gets printed for each iteration *) for the second loop, as p is incremented as well, it gets incremented by one array position and hence, the array is iterated.
|
|
| Post Reply |
|
|
|
 | | This thread is locked for new responses. Please post your comments and questions as a separate thread. If required, refer to the URL of this page in your new post. |
|
|
|
|
|
|