Pages
Home
C++/C- Programs
DOS Commands
BS Communication
Mathematics
Advertisement
About Us
Contact us
Tuesday, April 16, 2013
WAP to Illustrate use of Malloc Function
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,*p,
clrscr;
printf("Enter Number \n");
scanf("%d",&n);
p=(int*)malloc(n*sizeof(int));
for(i=0;i<n;i++)
{
scanf("%d",p);
p++;
}
p=p-n;
for(i=0;i<n;i++)
{
printf("\n%d",*p);
p++;
}
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment