Main(){ char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b));}

A) None of the above
B) “HelloWorld”
C) “Hello World”
D) “Hello”
Explanation: World, copies World on a, overwrites Hello in a.

Showing Answers 1 - 3 of 3 Answers

Amit

  • Dec 16th, 2005
 

"World".when we use strcpy..contents of a are overwritten.

  Was this answer useful?  Yes

vijay sharma

  • Jan 31st, 2006
 

this program will generate error as you are changing the contents of a const variable. as char *a ="Hello" signifies that a can point to some other location but its content can't be changed. strcpy(a,b) is copying b into a which is not allowed. So it will generate error.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions