hi :i have to write a program which should print its "source code" for output.how to do this.please make me a example of "source code" and make a definition of "source code".program shouldn't contain any file .
Hmmm.. its not that hard though.. you only need to use
FILE *fp = fopen(filename,"r") "r" means read only..
and read its byte by int read = fgetc( fp ).. use a loop
now use printf(":)") to print the read but first cast it to (char) (ex. char m = (char)read; ).. this is so because fgetc returns an unsigned char cast to an int..
or what do you mean by output..(where?)