In Header File:
struct myStruct{
int data;
struct myStruct *next;
};
typedef struct myStruct myStruct;
Relative Function:
myStruct * create(){
myStruct * a = NULL;
int size;
printf("Enter Size of List : ");
scanf("%d",&size);
for(int i = 0;i<size;i++){
/*
* can't seem to figure out how to do this correctly.
*
* I know I have to use malloc(sizeof()),etc..
*
* I've only had success with creating the list backwards.
*
* In this loop there would be a scan from user input for
* the data instance
*/
}
return a;
}
So I think that's pretty straightforward. Any help would be appreciated.