Surprisingly, main not differ to other functions (except it is a 'enter point' for program). Code below compiles with "hard" gcc flags and successfully works (echoing given arguments).
#include <stdio.h>
int main(int argc, char *argv[]) {
if (argc > 1) {
printf("%s\n", argv[1]);
main(argc - 1, argv + 1);
}
return 0;
}
No comments:
Post a Comment