// Ptr-& gt; d_off indicates the int type. // The compiling and execution environment is the LinuxUbuntuPC host. // Print the output code below. Accidentally writing % d into % s causes Segmentationfaultprintf ("ptr-& gt; d_off = % s; \ n", ptr-& gt; d_off); // After compilation, the following message is always prompted during execution: Segmentationfault // It took me several hours to find
// Ptr-> d_off indicates int type.
// The compiling and execution environment is Linux Ubuntu PC.
// Print the output code below. Accidentally writing % d as % s causes Segmentation fault
Printf ("ptr-> d_off = % s; \ n", ptr-> d_off );
// After compilation, the following message is always prompted during execution:
Segmentation fault
// It took me a few hours to find out the error
// Write it down. If you have time, think about why % s causes Segmentation fault.