Wednesday, February 10, 2010

Which of the following is the correct way to increment the variable "ptr"?

a) ptr = ptr + sizeof(myStruct); [Ans]
b) ++(int*)ptr;
c) ptr = ptr + sizeof(myArray);
d) increment(ptr);
e) ptr = ptr + sizeof(ptr);

No comments: