Last active
February 25, 2022 21:40
-
-
Save Ericson2314/c7cbc9b48765dfb6376a72d316369fa6 to your computer and use it in GitHub Desktop.
Main, the right way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int fixed_main( | |
size_t argc, | |
char const (*const (* argv)[argc + 1])[]) | |
{ | |
for (size_t i = 0; i < argc; i++) | |
{ | |
printf("%s\n", (*argv)[i]); | |
} | |
return EXIT_SUCCESS; | |
} | |
int main(int argc, char* argv[]) | |
{ | |
return fixed_main(argc, argv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment