What is the format of your text file? This will determine how you will parse it. There should be some data in the file, a file with nothing but whitespace is pretty useless.
Code:
int main(){
char* ar = readScores();
}
char* readScores() {
char* ar = (char*)malloc((40)*sizeof(char));
for(int i=0; i<40; i++){
scanf("%s", ar[i]);
printf("%s", ar[i]);
}
return ar;
}
This code should and probably will, crash. You have 40 bytes allocated, then you try to read an entire string "%s" into a single byte. Not only that, the expression ar[i] is a character value, not a pointer to character. If you want a pointer to char, use ar + i, or even &ar[i]. In any case, you need to allocate enough space for how ever many characters you are reading. With what you have now, you can read at most 39 characters at one time into the ar buffer.
Read the C tutorials on this site to learn how to read lines from a file, or search for "man fgets" and "man fscanf" to parse data. Without a description of your file format, that's about all I can say.