Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336
Point out the error in the following program. #include<stdio.h> #include<stdlib.h> int main() { int a[3]; a = (int) malloc(sizeof(int)3); free(a); return 0; } ?->(Show Answer!)
Question Set

1. Point out the error in the following program. #include<stdio.h> #include<stdlib.h> int main() { int a[3]; a = (int) malloc(sizeof(int)3); free(a); return 0; }





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 01 Jun 2017 06.02 pm
    We should store the address in a[i]
Show Similar Question And Answers
QA->Rahim travelled straight from point E to F at a distance of 5 km. From F he turned left and travelled 6 km and reached point G, there he took a left turn and travelled 5 km to reach point H. He took another left turn and travelled 2 km and reached point I. How far is he from the starting point ?....
QA->A word is given in capital letters. It is followed by four words. Out of these four words, three cannot be formed from the letters of the word in capital letters. Point out the word which can be formed from the letters of the given word in capital letters— ARCHITECTURE....
QA->Name the translatory program which translates the high level language into machine language before running the program?....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
MCQ->What will be the output of the program in 16-bit platform (under DOS)? #include<stdio.h> int main() { struct node { int data; struct node link; }; struct node p, q; p = (struct node ) malloc(sizeof(struct node)); q = (struct node ) malloc(sizeof(struct node)); printf("%d, %d\n", sizeof(p), sizeof(q)); return 0; }....
MCQ->Point out the correct statement which correctly free the memory pointed to by 's' and 'p' in the following program? #include<stdio.h> #include<stdlib.h> int main() { struct ex { int i; float j; char s }; struct ex p; p = (struct ex )malloc(sizeof(struct ex)); p->s = (char)malloc(20); return 0; }....
MCQ->Point out the error in the following program. #include<stdio.h> #include<stdlib.h> int main() { int a[3]; a = (int) malloc(sizeof(int)3); free(a); return 0; }....
MCQ->Assume integer is 2 bytes wide. What will be the output of the following code? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int (p)[MAXCOL]; p = (int () [MAXCOL])malloc(MAXROW sizeof(p)); printf("%d, %d\n", sizeof(p), sizeof(p)); return 0; }....
MCQ->How will you free the memory allocated by the following program? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int p, i, j; p = (int ) malloc(MAXROW sizeof(int)); return 0; }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution