S
sunil
Hi All,
Please have a look the below program
#include<stdlib.h>
int i = system("pwd");
I compiled the above program in UNIX ,it got compiled and
executed with out any errors.It prints the present working directory.Am
having certain doubts about this program.
1) without main how it got executed
2)is the system funcion is static
3) is the shell had executed that system command
if i write simply
#include<stdlib.h>
system("pwd")
it's thwoing errors at compilation stage
4) how return type is playing a role,is it mandatory
to collect the return type in C(upto my knowledge it's not mandatory to
collect the return type).
In case of any queries please revert me back.
Regards
Sunil
Please have a look the below program
#include<stdlib.h>
int i = system("pwd");
I compiled the above program in UNIX ,it got compiled and
executed with out any errors.It prints the present working directory.Am
having certain doubts about this program.
1) without main how it got executed
2)is the system funcion is static
3) is the shell had executed that system command
if i write simply
#include<stdlib.h>
system("pwd")
it's thwoing errors at compilation stage
4) how return type is playing a role,is it mandatory
to collect the return type in C(upto my knowledge it's not mandatory to
collect the return type).
In case of any queries please revert me back.
Regards
Sunil