write a C program to print the program itself ?!
Answer Posted / jaroosh
The most simple possible program printing itself on windows :
main()
{
char path[255];
sprintf(path,"cmd.exe /c type \"%s\"",__FILE__);
system(path);
}
on Unix you just use "cat" instead of "type" and necessary
fun to call bash command from c program.
| Is This Answer Correct ? | 17 Yes | 23 No |
Post New Answer View All Answers
What is meant by keywords in c?
how many errors in c explain deply
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What are the types of data files?
Why do we use header files in c?
What is wrong with this statement? Myname = 'robin';
Can a pointer be static?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
How is a structure member accessed?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
what is a function method?give example?
What is the benefit of using #define to declare a constant?
What is printf () in c?
In which layer of the network datastructure format change is done
What does != Mean in c?