0 compile error but 2 build error. need help please!
Code:
#include <stdio.h>
#include <stdlib.h>
#define howto "Enter a number 1-8 to select from the menu\n\n\n"
#define menu "*********************\n 1. Preorder\n 2. Inorder\n 3. Postorder\n 4. Update\n 5. Load\n 6. Save\n 7. Help\n 8. Quit\n*********************"
int list();
void load(int, char);
FILE * input;
int main(int argc, char* argv[])
{
int option;
printf(howto);
option = list();
while (option != 8)
{
system("cls");
option = list();
switch(option)
{
case 5:
load(argc, *argv[1]);
break;
}
}
return 0;
}
int list()
{
int option;
printf(menu);
scanf("%d", &option);
while (option < 1 || option > 8)
{
system("cls");
printf(menu);
scanf("%d", &option);
}
return option;
}
void load(int argc, char* argv[1])
{
int c;
int num;
int count = 0;
input = fopen(argv[1],"r");
num = atoi(argv[1]);
while((c = fgetc(input)) != EOF)
{
if(count < num)
}
fputc(c, stdout);
count++;
}
else
}
fprintf(stdout,"\n");
count = 0;
}
}
}
is what i have so far. the menu stuff all works fine, i've been testing as i've been going. i assume that these errors have something to do with the passing of argv and argc. i'm pretty confused.