#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <io.h>
#define len 256
typedef struct tree {
char a[10][len];
};
tree* getFiles(int, char**);
tree* appendFiles(tree*);
int main(int argc, char ** argv) {
tree* fileList;
fileList = getFiles(argc, argv);
appendFiles(fileList); //appendFiles is another function that isn't relevant to the problem.
return 0;
}
tree* getFiles(int unknown, char** location){
int check=0, spot=0;
tree* fileone; // this seems to be the problem
printf("Enter command line:");
for(check; check!='\n'; spot++){
scanf("%s", &fileone->a[spot]);
check=fgetc(stdin);
}
printf("[creating output file '%s']\n", fileone->a[spot-1]);
return fileone;
}
BTW, I know that I'm completely ignoring argv/argc which is passed to getFiles, but just ignore that(it's a requirement for the assignment that argv/argc be passed to getFiles, but we got behind and never discussed how to work with them).

New Topic/Question
Reply



MultiQuote



|