Main(){ char * strA; char * strB = I am OK; memcpy( strA, strB, 6);}

A) Compile error
B) I am OK
C) Runtime error.
D) I am O
Explanation: I am OK is not within " "

Showing Answers 1 - 6 of 6 Answers

Michael

  • Jan 16th, 2006
 

A

  Was this answer useful?  Yes

mahendra

  • Apr 16th, 2006
 

I fthe string is declared in the double codes then it will.

  Was this answer useful?  Yes

vikas

  • Apr 27th, 2006
 

Its the Runtime error as strA hasnt been allocated any memory

  Was this answer useful?  Yes

the memcpy function will copy n bytes from the object pointed by strB into strA. If the copying takes places between objects that overlap, the behaviour will be undefined. If these to char pointer is assigned an address which don't overflow, this would work.

Thanks,
mani

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