main()

{

char * strA;

char * strB = I am OK;

memcpy( strA, strB, 6);

}

a. Runtime error.

b. I am OK

c. Compile error

d. I am O

Answers were Sorted based on User's Feedback



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

Answer / chandra

Answer is (c)compile error

compiler cannot initialize the string with out "". Hence any
compiler throws an error

If the string is with in "", then answer will be(a) Runtime
error.
since the string strA is used with out being initialized

Is This Answer Correct ?    6 Yes 0 No

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

Answer / guest

c) I am OK is not in " "

Is This Answer Correct ?    5 Yes 2 No

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

Answer / madhu

Runtime error

Is This Answer Correct ?    2 Yes 1 No

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

Answer / prashant

if quotes are inserted ans will be -->
d) I am O

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Code Interview Questions

main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }

1 Answers   DCE,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }

1 Answers  


given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit

8 Answers  


What is full form of PEPSI

0 Answers  






why is printf("%d %d %d",i++,--i,i--);

4 Answers   Apple, Cynity, TCS,


how to return a multiple value from a function?

5 Answers   Wipro,


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,


main() { int i=5; printf(ā€œ%dā€,i=++i ==6); }

1 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  


main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  


Categories