f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
Answer Posted / fazlur rahaman naik
actually the above programme produces an error.because u've
to mention which type of pointer it is at fuction f(*p).
i.e f(char *p).
if u correct this error.then the out put will be
bye
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What does static variable mean in c?
Describe the steps to insert data into a singly linked list.
how to write a c program to print list of fruits in alpabetical order?
Explain how can you avoid including a header more than once?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Why is c known as a mother language?
What are unions in c?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
Explain what are binary trees?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Explain what is the difference between functions abs() and fabs()?
Differentiate between Macro and ordinary definition.
What is the purpose of void in c?
How can I recover the file name given an open stream?
Can we declare function inside main?