So I'm currently learning file processing for my assignment, and I'm wondering why this code
#include<stdio.h>
int main(){
char test[255];
FILE *open;
open = fopen("data.txt", "r");
while(fscanf(open, "%s", test)!=EOF){
printf("%s", test);
}
}
works while the following one
#include<stdio.h>
int main(){
char test[255];
FILE *open;
open = fopen("data.txt", "r");
fscanf(open,"%s", test);
printf("%s", *test);
}
didn't, any answer would be appreciated!