Submission #7633

#TimeUsernameProblemLanguageResultExecution timeMemory
7633aaaaRobots (APIO13_robots)C++98
Compilation error
0 ms0 KiB
#define SUDO "/usr/bin/sudo" int main(void) { char *arg0;//this should be actual command itself char *arg1,*arg2,*arg3,*arg4; arg0 = "sudo"; arg1 = "shutdown"; arg2 = "-h"; arg3 = "01:30"; arg4 = (char *)NULL; execl(SUDO,arg0,arg1,arg2,arg3,arg4); sleep(60*60); return 0; }

Compilation message (stderr)

robots.cpp: In function 'int main()':
robots.cpp:6:8: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
robots.cpp:7:8: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
robots.cpp:8:8: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
robots.cpp:9:8: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
robots.cpp:10:16: error: 'NULL' was not declared in this scope
robots.cpp:11:36: error: 'execl' was not declared in this scope
robots.cpp:12:12: error: 'sleep' was not declared in this scope