char* f()
return "hello:";
void main()
{char *str=f();
}



char* f() return "hello:"; void main() {char *str=f(); }..

Answer / parthiban

str will be a pointer to "hello:"

so on printing str will output hello:

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C C++ Errors Interview Questions

#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }

19 Answers  


void main() { int i=7; printf("N= %*d",i,i); }

6 Answers   HCL,


Why are memory errors hard to debug?

1 Answers  


Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .

2 Answers  


what is exceptions?

5 Answers   HCL, Wipro,






void main() { int i=5; printf("%d",i+++++i); }

14 Answers   HCL,


I'm having trouble with coming up with the correct code. Do I need to put a loop? Please let me know if I'm on the right track and what areas I need to correct. I still don't have a good grasp on this programming stuff. Thanks =) The assignment was to write a program using string functions that accepts a coded value of an item and displays its equivalent tag price. The base of the keys: 0 1 2 3 4 5 6 7 8 9 X C O M P U T E R S Sample I/O Dialogue: Enter coded value: TR.XX Tag Price : 68.00

3 Answers   UCB,


I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX

0 Answers  


Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.

1 Answers  


How to create a program that lists countries capitals when country is entered? (Terribly sorry, I'm a complete novist to coding with C, am looking for inspiration and general tips on how to code and create this program.)

0 Answers  


class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }

1 Answers  


Answering Yes or No in C++...using only stdio.h and conio.h..........help me please...? here's must be the output of the program: Screen A Exam No. items Score 1 20 20 2 35 35 Another Entry? [Y] or [N] : Screen B: Record No. Student's Name: 1 Fernando Torres 2 Chuck Norris Note: if you press Y, the program must repeat the procedure in screen A, then if N, the program must proceed to the screen B....Please Help me out............

1 Answers  


Categories