I have two functions, one which produces messages like Starting initialization...
and another which checks return codes and outputs \"Ok\"
, \
Additionally, if you want the flexibility of choosing the width
, you can choose between one of the following two formats (with or without truncation):
int width = 30;
//no truncation uses %-*s
printf( "%-*s %s\n", width, "Starting initialization...", "Ok." );
// output is "Starting initialization... Ok."
//truncated to the specified width uses %-.*s
printf( "%-.*s %s\n", width, "Starting initialization...", "Ok." );
// output is "Starting initialization... Ok."