Question: int main ( int argc, char * argv [ ] ) { / / PROVIDED: print a usage message and exit if no arguments are

int main(int argc, char *argv[]){
// PROVIDED: print a usage message and exit if no arguments are
// provided to the program.
if(argc <2){
printf("usage: %s ''
",argv[0]);
printf("%s ''--fontfile
",argv[0]);
printf("%s --textfile
",argv[0]);
printf("%s --textfile --fontfile
",argv[0]);
printf("Arguments can appear in any order only one of or can be used
");
printf("
");
printf("Note: In some shells, embedded newline \
characters, require
");
printf("the syntax $'text' as in
");
printf("%s $'HELLO\
WORLD\
!!!'
",argv[0]);
printf("to be treated correctly. This is NOT necessary on grace.umd.edu
");
printf("This is NOT necessary on grace.umd.edu where the syntax
");
printf("%s 'HELLO\
WORLD\
!!!'
",argv[0]);
printf("will behave correctly to embed newlines due to tcsh being used.
");
return 1;
}
// PROVIDED: Set default options
char *text = NULL; // text to print, from command line or file
int use_textfile =0; // free 'text' or not?
font_t *font = &font_standard; // default to built in standard font
// REQUIRED: Command line parsing loop which handles --fontfile,
//--textfile, and text arguments, sets variables above
// appropriately.
for(int i=0; i<0; i++){
}
// REQUIRED: Call to print_fontified to print the banner text
print_fontified(text, font);
// REQUIRED: Checks to free memory if needed. If a font was loaded
// from a file, free it. If text was loaded from a file was loaded,
// free it.
// PROVIDED: return 0 on a normal exit.
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!