Aright, here it is. This time including the Print function, since it's what's causing me this trouble.
Code:
#include <stdlib.h>
#include <stdio.h>
#define big 2000
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 = malloc(sizeof(*num));
//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);
}
//Read the array
printf("\n The arrays are: ");
for (k=0; k<stringnum; k++){
for (i=0; i<j; i++)
printf ("%d ", num[k].digits[i]);
printf("\n");
}
system("PAUSE");
return 0;
};
int readnum(int stringnum, char* numbr, struct integer *emp){
int arraysize = strlen(numbr);
emp->digits = malloc(sizeof(*emp->digits) * arraysize);
//Move the integer into the array
for(i=arraysize, j=0; i>-1; i--){
if(isdigit(numbr[i])){
emp->digits[j++] = numbr[i] - '0';
}
}
};