program that find a defined macros in source files,count and print

The program which should take file names from windows command line.
c:\mac_find main.cpp chars.h
the output of the program should print information like 1)total macros found 2)in which line the macros found and name of it.
example : if the file name is main.cpp, then the output should be
file:main.cpp
macros:3
macro at line:7 -> #define Test
macro at line:8 -> #define Play

If a file does not exist, then simply print an error message and continue searching for macros in other files.

Kindly help on writing the code.
Topic archived. No new replies allowed.