Command-line arguments: Difference between revisions

m
→‎{{header|C}}: stdlibo -> stdlib
m (→‎{{header|C}}: stdlibo -> stdlib)
Line 169:
Be careful on systems that use Unicode or other multibyte character sets. You may need to use a type of _wchar* and multi-byte-character-set-aware versions of printf.
 
<lang c>#include <stdlibostdlib.h>
#include <stdio.h>
 
int main(int argc, char* argv[])
{
signed int i;
(void) printf("This program is named %s.\n", argv[0]);
for (i = 1; i < argc; ++i)
(void) printf("the argument #%d is %s\n", i, argv[i]);
return EXIT_SUCCESS;
}</lang>