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
Which built-in library function can be used to match a patter from the string?
What is #line used for?
what is the difference between 123 and 0123 in c?
What are the advantages of the functions?
Is a house a shell structure?
Explain the difference between structs and unions in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What are the types of variables in c?
How important is structure in life?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
How can you determine the maximum value that a numeric variable can hold?
Explain the array representation of a binary tree in C.
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?
What is variable and explain rules to declare variable in c?