C Pointers Test 26) What will be the output of a program?
The correct option is (c). Explanation: As C-Language is machine dependent language. Therefore it will give different output in other platforms (depending upon machine and compiler). If we execute and compile this program in Windows platform using Turbo C, then it will give output "ello llo lo o". If we execute and compile this program in Linux platform using GCC Compiler, then it will give output "Hello ello llo lo o". 7) How many bytes are occupied by far, near and huge pointers in DOS (Disk Operating System)?
The correct option is (c). Explanation: Under Linux and Windows every pointer is 4 bytes long. Under DOS the value of near, far and huge pointer is:
8) What will be the output of a program?
The correct option is (c). Explanation: In normal pointer assignment, when function (fun()) is called it's received as (j), so whatever operation performed on j will be returned at i in main. After the function call, Therefore the address of (b) get stored in (i) when we use statement *j=&b. 9) The below program reports an error on compilation.
The correct option is (b). Explanation: There is no error on compilation of the program in GCC under Linux and Turbo C under DOS. The output of the program is 12.000000. 10) Are the three declarations char **ball, char *ball[], and char ball[][] same?
The correct option is (b). Explanation: No, the three declarations char **ball, char *ball[], and char ball[][] are different. char **ball - It is a double pointer char *ball[] -It is an array of pointers char ball[][]-It is 2-d array. |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India