learn:programming_c
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| learn:programming_c [2026/06/18 00:36] – [Managing a Project] azman | learn:programming_c [2026/08/11 09:28] (current) – azman | ||
|---|---|---|---|
| Line 90: | Line 90: | ||
| It is sometimes very useful to be able to provide information (@input) to the program at command line. This can be made possible by declaring 2 parameters: <code c param.c> | It is sometimes very useful to be able to provide information (@input) to the program at command line. This can be made possible by declaring 2 parameters: <code c param.c> | ||
| # | # | ||
| - | int main(int argc, char *argv[]) | + | int main(int argc, char *argv[]) { |
| - | { | + | |
| int loop; | int loop; | ||
| printf(" | printf(" | ||
| - | for(loop=0; | + | for (loop=0; |
| - | | + | |
| printf(" | printf(" | ||
| } | } | ||
| Line 112: | Line 110: | ||
| # | # | ||
| # | # | ||
| - | + | int main(int argc, char** argv) { | |
| - | int main(int argc, char** argv) | + | |
| - | { | + | |
| int loop; | int loop; | ||
| - | if (argc<2) | + | if (argc<2) { |
| - | { | + | |
| printf(" | printf(" | ||
| printf(" | printf(" | ||
| Line 127: | Line 122: | ||
| printf(" | printf(" | ||
| } | } | ||
| - | for (loop=1; | + | for (loop=1; |
| - | { | + | if (!strcasecmp(argv[loop]," |
| - | if (!strcasecmp(argv[loop]," | + | |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
| - | else if (!strcasecmp(argv[loop]," | + | else if (!strcasecmp(argv[loop]," |
| - | { | + | |
| printf(" | printf(" | ||
| } | } | ||
learn/programming_c.1781742975.txt.gz · Last modified: by azman
