Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

1 Answers   TCS,


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


How to access command-line arguments?

4 Answers  


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

1 Answers  


There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

9 Answers   CSC, GoDB Tech, IBM,


write a program for area of circumference of shapes

0 Answers  


How we print the table of 3 using for loop in c programing?

7 Answers  


Categories