What is the output of the programvoid main(){struct a{int i;char *st1;};typedef struct a ST;ST *str1;str1=(ST*)malloc(100);str1->i=100;strcpy(str1->st1,"Welcome to Oracle");printf(" %d%sn",str1->i,str1->st1);getch();}A. core dumpB. will not compileC. 100,Welcome to OracleD. None of these

C

This question is related to Oracle Interview

Showing Answers 1 - 1 of 1 Answers

Johon

  • Aug 28th, 2005
 

A. 
The strcpy() will seg fault as there's no allocated memory for the destination string.

  Was this answer useful?  Yes

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