Home > Back-end >  Don't see why there will be a segmentation fault, turn to your bosses
Don't see why there will be a segmentation fault, turn to your bosses

Time:11-16

#include
Struct Entry {
Char * name;
Char * number;
Char * department;
};

Void addnumber (struct Entry * * library);

Void main (void) {
Struct directory Entry *=NULL;
Addnumber (& amp; Directory);
}

Void addnumber (struct Entry * * library) {
The library (* *). The name="abcde";
}

CodePudding user response:

Do you need for the allocated space, or is the use of the null pointer

Struct directory Entry *=malloc (sizeof (struct Entry));
  • Related