Code Competitions

Coding competition

Monday, 13 May 2013

program to show the use of DMA fuctions.

#include<stdio.h>
#include<conio.h>
void main()
{
    int size,*ptr,*t;
    clrscr();

    printf("Enter the size");
    scanf("%d",&size);
    ptr=(int *) malloc(size*(sizeof(int)));
    for(t=ptr;t<ptr+size;t++)
    {
        scanf("%d",t);
    }
    for(t=ptr;t<ptr+size;t++)
    {
        printf("%d\t",*t);
    }
    free(ptr);
}

No comments:

Post a Comment