I have searched this board without any luch and unfortunatly my C book does not give an example of calling another program from a menu.
Can someone steer me in the right direction?
I'm in the dark on this this one. I would like to gain the knowledge on this one.
Thanks for any help you can provide.
Code:
/*
Menu
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "carpet.h"
#include "c:\mydocu~1\pa17.rpt" <---The compiler screams at this
void function1( int);
void function2( int);
void function3( int);
main()
{
void (*f[3]) ( int) = {function1, function2, function3};
int choice;
printf("0 = Carpet Information Data Entry\n");
printf("1 = Generate Reports\n");
printf("2 = Utilities\n");
printf("3 = End Program\n");
scanf("%d", &choice);
while (choice >= 0 && choice < 3)
{
(*f[choice]) (choice);
printf("0 = Carpet Information Data Entry\n");
printf("1 = Generate Reports\n");
printf("2 = Utilities\n");
printf("3 = End Program\n");
scanf("%d", &choice);
}//end while loop
printf("Program has terminated\n");
return 0;
}
void function1(int a)
{
system("cls");
printf("%d\n", a);
printf("%d\n", carpetCharge1);
}//end function1
void function2(int b)
{
system("cls");
fopenf(c:\mydocu~1\pa17.rpt", "rb"); <-- This doesn't work either
printf("%d\n", b);
}//end function2
void function3(int c)
{
system("cls");
printf("%d\n", c);
}//end function3