NTFS
Member level 3
challenge: self writer
Hi all
My teacher gave an exercise that I need your help to solve it.
we have to write a program in C++ that print itself (source code).
I mean, the two following commands should have same output:
1) myprog.exe
2) type myprog.cpp
we can't use stream or another file, just we can use C++ instructions like: for , if and etc.
Please guide me to solve it.
Thanks in advance.
Hi all
My teacher gave an exercise that I need your help to solve it.
we have to write a program in C++ that print itself (source code).
I mean, the two following commands should have same output:
1) myprog.exe
2) type myprog.cpp
we can't use stream or another file, just we can use C++ instructions like: for , if and etc.
Please guide me to solve it.
Thanks in advance.