Guest_imported
New member
- Jan 1, 1970
- 0
Please let me know what I am doing wrong. I can not get this code to compile correctly.
Thanks
#include<stdio.h>
#include<stdlib.h>
#include"player.h"
int* readtopps(char* fn[], int* num);
int readwants(Player* p, char* wantfn, int year);
void compare(int*, int, Player*, int);
void main(int argc,char *argv[])
{
int i, num, n1;
int* ptr;
int year[20];
char fn[80];
Player* p;
char wantfn[] = "wantfile";
if(argc < 2)
{
printf("You forgot to enter years.\n"
exit(1);
}
for(i = 1; i <= argc; i++)
{
year = atoi(argv);
sprintf(fn, "topps.%d", year);
ptr = (readtopps(fn, &num));
n1 = (readwants(p, wantfn, year));
compare(ptr, num, p, n1);
}
}
Thanks
#include<stdio.h>
#include<stdlib.h>
#include"player.h"
int* readtopps(char* fn[], int* num);
int readwants(Player* p, char* wantfn, int year);
void compare(int*, int, Player*, int);
void main(int argc,char *argv[])
{
int i, num, n1;
int* ptr;
int year[20];
char fn[80];
Player* p;
char wantfn[] = "wantfile";
if(argc < 2)
{
printf("You forgot to enter years.\n"
exit(1);
}
for(i = 1; i <= argc; i++)
{
year = atoi(argv);
sprintf(fn, "topps.%d", year);
ptr = (readtopps(fn, &num));
n1 = (readwants(p, wantfn, year));
compare(ptr, num, p, n1);
}
}