what would be the output of the following program?
main()
{
int k = 123;
char *ptr;
ptr = &k;
printf("%d",*ptr);
}
Answer Posted / srsabariselvan
The program results in compilation error.
NOTE: a pointer can stores the address of same data type.
it can't store the address of another data type.
i.e.,
character pointer can stores the address of character data.
it can't store the address of integer data.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What are the salient features of c languages?
Explain how can I manipulate strings of multibyte characters?
What are predefined functions in c?
Write a Program to find whether the given number or string is palindrome.
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
How can you avoid including a header more than once?
What are the different types of pointers used in c language?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What is a class c rental property?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
What does void main return?
Which type of language is c?
Write a program to reverse a linked list in c.