Perform type casting when assigning dynamic memory to a variable for malloc() function. - C Data Type

C examples for Data Type:Type Cast

Description

Perform type casting when assigning dynamic memory to a variable for malloc() function.

Demo Code

#include <stdio.h> 
#include <stdlib.h> 
int main()// ww  w  . j a v  a  2s .  com
{ 
   char *name; 
   name = (char *) malloc(80); 
}

Related Tutorials