Q. | What will be output if you will execute following code? #include
int main(){
char *array[4]={"c","c++","java","sql"};
char *(*ptr)[4]=&array;
printf("%s ",++(*ptr)[2]);
return 0;
}
|
|||||||
|
Answer: | Option C | |
Explaination: | ptr: It is pointer to array of string of size 4. array[4]: It is an array and its content are string.
++(*ptr)[2]
=++(*&array)[2] //ptr=&array
=++array[2]
=++"java"
="ava" //Since ptr is character pointer so it
// will increment only one byte
|
Discussion
Your Comments Goes here... |
Name | Discussion |
---|