I have homework assignment where I need to write a program to replace include commands (assuming there are no standard library includes) of C file with the actual.h' file (performing the preprocessor's job).
I thought using regex matching, but since we are only allowed to use ansi-C's standard libraries regex is not allowed.
I am not sure what is the efficient way to do so?
edit: there is no need to check for #defines
or #ifdefs
.
I suggest you follow this guide to create your program:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.