f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?
Answer Posted / anu
the output wll be hello , since the argument is overwritten
with new memory in the function.
so in main, when it comes to printf, p points to the
allocatd memory, which contains hello
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
which is an algorithm for sorting in a growing Lexicographic order
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
How does normalization of huge pointer works?
c program to compute AREA under integral
When can you use a pointer with a function?
What is assignment operator?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is indirection? How many levels of pointers can you have?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
how do you execute a c program in unix.
C language questions for civil engineering
how to find anagram without using string functions using only loops in c programming
Explain what are reserved words?