Malloc Function in C

The malloc() function allocates single block of requested memory.

Source Code

//malloc in Pointers
int main()
    //void* malloc(size_t size)
    int i,n;
    printf("\nEnter The Limit : ");
    int *ptr=(int *)malloc(n*sizeof(int));
          printf("Memory Not Available ...");
    for(i=0; i<n; i++)
        printf("Enter a integer : ");
        printf("%d  ",*(ptr+i));  // ptr+1
    return 0;
To download raw file Click Here

List of Programs

Sample Programs

Switch Case in C

Conditional Operators in C

Goto Statement in C

While Loop Example Programs

Looping Statements in C

For Loop Example Programs

Array Examples in C

One Dimensional Array

Two Dimensional Array in C

String Example Programs in C

Functions Example Programs in C

Learn All in Tamil © Designed & Developed By Tutor Joes