(struct node *)malloc(1*sizeof(struct node)); | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

(struct node *)malloc(1*sizeof(struct node));

Can you tell me what is the meaning of (struct node *) in here.

22nd Nov 2018, 2:57 PM
Jishnu
Jishnu - avatar
1 Antwort
+ 4
It is used for casting the memory block allocated by malloc() into a pointer of node structure. Hth, cmiiw
24th Nov 2018, 10:42 AM
Ipang