ヘッダー ファイル内:
struct myStruct{
int data;
struct myStruct *next;
};
typedef struct myStruct myStruct;
相対機能:
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;
}
だから私はそれはかなり簡単だと思います。どんな助けでも大歓迎です。