I need to write a short program in C where the file type is displayed when executed. Fot example ./a.out test.doc would print "the file is in .doc format".

I'm pretty sure I need to use arg[c] and arg[v] in the code, but beyond that I'm pretty lost. Can someone show me the basic structure of how to do this?

Thank you,
crazychile