Here's the program without the 3 (Unfinished and commented out) extra functions and the bottom printf:
Code:
#include <stdlib.h>
#include <stdio.h>
struct integer {
int* digits;
int size;
};
int i, j, k, stringnum;
int readnum(int stringnum, char* numbr, struct integer *emp);
int main(){
FILE *ifp;
char numbr[big];
struct integer *num = (struct integer *)malloc(sizeof(int));
//Read in the file
ifp = fopen("bigint.txt", "r");
//Scan for the number of strings
fscanf(ifp, "%d", &stringnum);
//Read in the numbers
for (k=0; k<stringnum; k++){
fscanf(ifp, "%s", numbr);
readnum(k, numbr, num);
}
system("PAUSE");
return 0;
};
int readnum(int stringnum, char* numbr, struct integer *emp){
int arraysize = strlen(numbr);
int* numtemp = (int*)malloc(sizeof(int)*arraysize);
//Move the integer into the array
for(i=arraysize, j=0; i>-1; i--){
if(isdigit(numbr[i])){
*emp[j++].digits = strtok(numbr[i], " ");
}
}