Sscanf (buf, "% * [^ & lt;] <[% ^ & gt;]>" , iniDefaultPlate);
Sscanf (buf, "& lt; [% ^ & gt;]>" , _platecolor [I]. Color);
Sscanf (buf, "& lt; [% d | % ^ & gt;]>" , & amp; M [I] No, m [I] Code);
CodePudding user response:
This is read in the data may be greater than your save data memory space of the variables ofIf Windows can use the sscanf_s finally add a length parameter
CodePudding user response:
Through sscanf () function to write the content in the character array buf, the need to specify the size of the writing, otherwise, when the content of writing than buf, will produce overflow,char name [100].
Fscanf (wp, "% 99 s", name);
At this time, you need to specify the width of the write 99,