| Jesuino (4) | |
|
Hi, Good Morning! I want to print a variable value inside a preprocessor directive! E.g.: #define D(value) value main(){ char[] test = "testing"; D(test); //I wanna send the value of test, and not the name of the variable } I already saw this in a C book, but i dont remember the name of the book... Could Someone Help-me? Thanks in advanced!! | |
|
Last edited on
|
|
| helios (9442) | |
|
Impossible. Macros are expanded before even starting compiling, so there's no way to pass something that doesn't exist, yet. Maybe this is what you're trying to do? http://www.cplusplus.com/forum/beginner/11252/ | |
|
Last edited on
|
|
| Jesuino (4) | |
|
Oh, Ok! I'll Explain my project. I'm making a programming language on top of C to improve the generation of report. So, we don't need lose more time with "printf" and anothers I/O functions. The basic idea is use a language XML to generate the out of report. To interpret this language I use a file with the configuration and the semantic of the tags used in XML. Now, I would make a improvement, allowing the user to add some codes in configuration file. But, i'll need to try another way to make it!! Thanks a lot! | |
|
|
|
| kbw (4336) | |||
| |||
|
|
|||