Quantcast
Channel: User rmn - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Printing the contents of a file using the #include directive (preprocessor)

$
0
0

Say I have a file, t.txt, that contains the following two lines:

one    two

Now, I would like to write a program which will #include that file somehow and print its contents, nothing more. That is, I want the contents of that file to appear in my code as a static text, at compile time.

Any ideas?


The reason im asking is this:

I would like to create a quine by including my own file (with ifndefs to prevent recursive inclusion after the first two): http://en.wikipedia.org/wiki/Quine_(computing). So I'd still love to get an answer.


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>