- 3
Find The error in this program
#include <stdio.h> #include <conio.h> #include <stdlib.h> int main() { int *ptr,n1,n2,i; printf("enter the size of an memory"); scanf("%d",&n1); ptr=(int*)malloc(n1*sizeof(n1)); printf("enter the elements"); for(i=0;i<n1;++i) { scanf("%d",ptr); printf("%d\n",*ptr); ptr++; } printf("enter new size of memory"); scanf("%d",&n2); ptr = (int *) realloc(ptr, n2); for(i=0;i<n2;++i) { scanf("%d",ptr); printf("%d",*ptr); ptr++; } }
1 Answer
+ 3
Please avoid writing code into the Relevant Tags section, the preferable way was to add a link to a saved code for a review.
Kindly take some points from this guide to creating an eye-catching post:
https://www.sololearn.com/Discuss/333866/?ref=app