I'm moving from VB to C,
I've learned about the basics of c upto using arrays.
I'm self-studying & experimenting now how to display text files as databases.
this is the code i use to display text files:
#include<stdio.h>
int main()
{
FILE *f;
char buf[100];
f = fopen("test.txt","r");
fgets(buf,sizeof(buf),f);
fclose(f);
printf("%s\n",buf);
system("Pause");
return 0;
}
Yeah, i've come across this on the net in a tutorial. :(
This command only prints one line in the text box, but when it comes to multilined text files, it wont display properly. T_T
Do i need the function fread()? If yes how do i call it?
Any suggestions?