First, check to see if there the number of arguments passed isn't 2 (your program and the variable). If so, print an error message / usage message and quit. Otherwise, transform the relevant argument (argv[1]) into a number and print your add1 function.
nonono. I know how to get the program to work if all I want to is to get my function working.
int a;
printf("type a number to add one");
scanf("&d",&a);
printf("&d",add1(a));
getch();
What I want my program to do is if I compile it and type the following in the command prompt
"add1 1" it will automatically give me 2
then if i type "add 2" it will automatically give me 3.
I think the user wants an endless input loop where he can type add1 x multiple times and it will add one and output. Just put a loop around it until you wish to quit.