H
hpy_awad
What should I do to avoid the message :
parameter 'argc' is never used
My program is down :
*--------------------
/* Book name : The prodessional programmers guide to C
File name : E:\programs\bc\witi01\ch10\main.c
Program discription: TV rental system menu driven-ver01-W
*/
#include <stdio.h>
main(int argc,char *argv[])
{
int option;
do
{
display_menu();
option=user_selection();
if (option!=7) /*Exit*/
call_program(option,argv);
} while (option!=7);
}
display_menu()
{
system("cls");
printf ("\n TV Rental system");
printf ("\n ----------------");
printf("\n\n 1 Set up new customer");
printf("\n\n 2 Change existing customer record");
printf("\n\n 3 Add new customer record");
printf("\n\n 4 Delete customer record");
printf("\n\n 5 Print customer bills");
printf("\n\n 6 display a customer record");
printf("\n\n 7 Exit");
}
user_selection()
{
int opt;
printf("\n Enter required option(1-7) : ");
/*scanf("\n");*/
scanf("%d",&opt);
return (opt);
}
call_program(int opt,char *argv[])
{
switch(opt)
{
case 1:
/*module OK 1 Set up new customer*/
spawnvp(0,"tvfsup2.exe",argv);
delay();
break;
case 2:
/*module OK 2 Change existing customer record*/
spawnvp(0,"tvfalt2.exe",argv);
delay();
break;
case 3:
/*module OK 3 Add new customer record*/
spawnvp(0,"tvfadd2.exe",argv);
delay();
break;
case 4:
/*module OK 4 Delete customer record*/
spawnvp(0,"tvfdel2.exe",argv);
delay();
break;
case 5:
/*module OK 5 Print customer bills*/
spawnvp(0,"tv19.exe",argv);
delay();
break;
case 6:
/*module OK 6 display a customer record*/
spawnvp(0,"tvfrec2.exe",argv);
delay();
break;
default:
printf("\n incoreect input");
delay();
exit(0);
}
}
delay()
{
double i;
for (i=0;i<31000;i=i+0.5);
}
parameter 'argc' is never used
My program is down :
*--------------------
/* Book name : The prodessional programmers guide to C
File name : E:\programs\bc\witi01\ch10\main.c
Program discription: TV rental system menu driven-ver01-W
*/
#include <stdio.h>
main(int argc,char *argv[])
{
int option;
do
{
display_menu();
option=user_selection();
if (option!=7) /*Exit*/
call_program(option,argv);
} while (option!=7);
}
display_menu()
{
system("cls");
printf ("\n TV Rental system");
printf ("\n ----------------");
printf("\n\n 1 Set up new customer");
printf("\n\n 2 Change existing customer record");
printf("\n\n 3 Add new customer record");
printf("\n\n 4 Delete customer record");
printf("\n\n 5 Print customer bills");
printf("\n\n 6 display a customer record");
printf("\n\n 7 Exit");
}
user_selection()
{
int opt;
printf("\n Enter required option(1-7) : ");
/*scanf("\n");*/
scanf("%d",&opt);
return (opt);
}
call_program(int opt,char *argv[])
{
switch(opt)
{
case 1:
/*module OK 1 Set up new customer*/
spawnvp(0,"tvfsup2.exe",argv);
delay();
break;
case 2:
/*module OK 2 Change existing customer record*/
spawnvp(0,"tvfalt2.exe",argv);
delay();
break;
case 3:
/*module OK 3 Add new customer record*/
spawnvp(0,"tvfadd2.exe",argv);
delay();
break;
case 4:
/*module OK 4 Delete customer record*/
spawnvp(0,"tvfdel2.exe",argv);
delay();
break;
case 5:
/*module OK 5 Print customer bills*/
spawnvp(0,"tv19.exe",argv);
delay();
break;
case 6:
/*module OK 6 display a customer record*/
spawnvp(0,"tvfrec2.exe",argv);
delay();
break;
default:
printf("\n incoreect input");
delay();
exit(0);
}
}
delay()
{
double i;
for (i=0;i<31000;i=i+0.5);
}