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
How many types of sorting are there in c?
What is a pointer in c?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain #pragma statements.
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is default value of global variable in c?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What are types of structure?
What are the 4 types of functions?
difference between object file and executable file
What are the advantages of using linked list for tree construction?
How old is c programming language?
What is c programming structure?
Can variables be declared anywhere in c?
What is a string?