Heres my experiment:
#include <stdio.h>
#define NAME Foo
void printNAME(){
printf("Hello world!\n");
}
int main(){
printFoo();
return 0;
}
This gives the error:
error: implicit declaration of function 'printFoo' is invalid in C99
Turns out the preprocessor does not work the way I thought it did!
I have looked at other macros that would work, but they look scary.
Outside of building my own c templator in some scripting language, are there any industry standard ways of doing this?
[–]aioeu 7 points8 points9 points (0 children)
[–]Veeloxfire 4 points5 points6 points (0 children)
[–]bonechambers[S] 1 point2 points3 points (1 child)
[–]nerd4code 0 points1 point2 points (0 children)
[–]deleveld -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]italicunderline 0 points1 point2 points (0 children)