c++ - Example from "Sams teach yourself C" Uses "fgets" but returns errors -
The code included is absolutely out of the book example, but it returns errors, is there anything that the book has done wrongly? I have the compiler says #include & lt; String.h & gt; Before , only
#include & lt; Stdio.h & gt; , but still what I am doing should be three arguments.
#include & lt; Stdio.h & gt; #include & lt; String.h & gt; Int main (zero) {four buffer [256]; Printf ("Enter your name and & lt; enter & gt ;: \ n"); Fgets (buffer); Printf ("\ nYour name is% d characters and spaces!", Stellen (buffer)); Return 0; }
meaningful issue with fgets (buffer); - Very few arguments to call, than 3, 1 format String is a problem (Stellen (buffer)); - Specifies 'int' in format, but the logic type is 'unsigned long'
Comments
Post a Comment