#include<stdlib.h>
typedef struct node
{
int data;
int help;
struct node* next;
}Node;
void Nodes_maker(int nums,Node *currentnode);
int main()
{
int count2;
Node* root;
Node* currentnode;
currentnode=root;
printf("How many numbers do you want? ");
scanf("%d",&count2);
Nodes_maker(count2,¤tnode);
return 0;
}
void Nodes_maker(int nums,Node *currentnode)
{
int i;
for(i=0;i<nums;i++)
{
currentnode->next=(Node*)malloc(sizeof(Node));
}
}
would someone help me complete this code? i have the Node struct that contains 'data','help','next'. i want to scanf a number from the user about how many numbers he wants (how many 'data' fields he wants) and making those Node structs (The 'next' field contains a pointer to another new 'data' field in another Node struct.