No it's not considered cheating. You can use any way you want to achieve the required result, as long as not you don't use someone else's work. We all search the web for little and big code examples and how to use them. Every programmer does.
That said, as Ashish Patel has said, it would be better to follow the instructions in the walkthroughs, as they are there to teach you something for your next psets.
The reason I write this as a separate answer, is to answer your other question, about the
. in the
According to cppreference.com:
. followed by integer number or
*, or neither that specifies precision of the conversion. In the case when
* is used, the precision is specified by an additional argument of type
int. If the value of this argument is negative, it is ignored. If neither a number nor
* is used, the precision is taken as zero. See the table below for exact effects of precision.
and the table bellow for the
s modifier specifies:
Precision specifies the maximum number of bytes to be written. If Precision is not specified, writes every byte up to and not including the first null terminator.
Feel free to visit the site and make yourself more comfortable with
printf(). You will use it a lot. :)