On Wed 2008-07-30 08:40:44 UTC+0100, kathir resh ([EMAIL PROTECTED]) wrote:
> #include<stdio.h>
> #include<conio.h>
> void main()
> {
> int i;
> i=main();
> printf("%d",i);
> }
>
> instead of i=main() using i=printf("hai");
>
> returns no of characters printed.why cant i get i to print wh the
> main() returns..if not give the correct procedure
main() returns an int, not void.
But in any case, the return value of main() is unavailable from within
your program. Once main() has returned, your program has ended. You
are trying to turn back time. Only timelords can do that.
The calling process can tell you what the return value is, for example
/bin/bash in Linux or cmd.exe in Windows. This has already been
covered in a recent thread on this mailing list.
By the way, conio.h is specific to Borland C++, and your code has no
use for it.