Home > Back-end >  A text about C language written to have problems with gibberish
A text about C language written to have problems with gibberish

Time:09-25

Building structure object, in this case write data without the code

Allocates memory to establish a structure pointer, and this kind of circumstance also can write data, but there is the code to populate the

Why is this?
How should change?

CodePudding user response:

The User can p the compiler through
Can use fread read correctly

CodePudding user response:

Malloc is not initialized, don't want to memset after garbled malloc memory,
Structure your did initialization,

CodePudding user response:

refer to the second floor qiushot response:
malloc is not initialized, don't want to memset after garbled malloc memory,
Structure your initialization,


After using memset problem solved, really is the problem, thank you very much!

CodePudding user response:

Struct type declaration, if you want to initialize also need to define the structure variable,
  • Related