:: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
Categories >> Software >> Programming Languages >> C


Question main()
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
what is the output?

 Question Asked In Companies :: HCL, Ramco, Zycus Infotech, AMCAT,     < I also faced this Question! >
 Question Submitted By :: naveed
  Answer Posted By  
A part of uninitialized (and/or unowned) memory after (and
including) the sixth byte of the malloc-ed memory will be
printed out until reaching a NULL character in the memory

Is This Answer Correct ?    5 Yes 4 No

  ali fakoor
View All Answers
Please Help Members By Posting Answers For Below Questions
 Question Views   Select
main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : printf("A"); break; case 0 : printf("B"); break; default : printf("C"); break; }} while(i<3); } 431
what is the basis for selection of arrays or pointers as data structure in a program 2246
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard. 745
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc 1619
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list) 408
c program to compute AREA under integral 440
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program? 278
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon 3565
what is reason of your company position's in india no. 1. 648
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length. 488
write a program to copy the string using switch case? 1235
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive. 362
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits. 2202
how to find anagram without using string functions using only loops in c programming 1547
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain..... 333
E-Mail New Answers        Answer Selected Questions