Ah thank you very much; it's working perfectly now.
Type: Posts; User: VinrVanyali
Ah thank you very much; it's working perfectly now.
#include <stdio.h>
#include <stdlib.h>
struct nodePayload{
int number;
};
struct node{
struct nodePayload *payload;
struct node *next;
temp->payload = malloc(sizeof(struct nodePayload));
I'm very new to c. I tried adding this before the first malloc, but I don't know what I'm doing. Can you spell it out for me?
What should I have done?
Also it crashes on its third running of S_ADD.
#include <stdio.h>
#include <stdlib.h>
struct nodePayload{
int number;
};
struct node{
struct nodePayload *payload;
struct node *next;