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 is meant by type casting?
Which built-in library function can be used to match a patter from the string?
What does emoji p mean?
FILE PROGRAMMING
Explain what is dynamic data structure?
Explain bit masking in c?
What is dangling pointer in c?
Can you tell me how to check whether a linked list is circular?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What are the 5 elements of structure?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
What are the different properties of variable number of arguments?
I need previous papers of CSC.......plz help out by posting them.......
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain what is the benefit of using const for declaring constants?