This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C21/ex1.c

21 lines
295 B
C
Raw Permalink Normal View History

2023-10-26 19:24:04 +00:00
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int age;
char name[10];
if ( argc != 3 )
{
printf ("USAGE: %s name age\n",argv[0]);
exit (0);
}
sscanf(argv[1],"%s",name);
sscanf(argv[2],"%d",&age);
printf ("age=%d name=%s\n", age, name);
return 0;
}