Instead of putting in 40 for the for loop i want to get the length of the array which is where i want to store the information from the file. Would I use strlen or sizeof? Overall, how would i take in the information from the file and then store it in the array to get the size of the array in the for loop where the 40 would have been. Thank you. Also I am assuming to use strlen, correct?
Int40 *loadPlainText(char *fname){//declare function
int i; //for eventual for loop
char c;//declare character c
Int40 *Point=createInt40(); //call the create function because it returns a pointer to the int40 struct that holds an array filled with 0s
//something has to catch the value that the function returns. thats why its equal to structure
FILE* ifp = fopen(inputFilename, "r");//opens thew file in read mode
int arr[40];//declare an array
for(i=0;i<=40;i++){//for loop
fscanf(ifp, "%c", &arr[i]);//read file into an array
Point->digits[i]=c;
}//end for loop
return Point;//return the pointer
}//end function