Guys, please help me understand what wrong with the below code. I just trying a simple read from an existing file and output it to terminal.
When i compile and execute the above code I get the following:Code:#include<stdio.h> int main() { FILE *filed; char *buffer; filed = fopen("ffile.txt", "r"); fread(buffer, 64, 5, filed); fwrite(buffer, 64, 5, stdout); fclose(filed); exit(0); }
Definately its something with syntax of fwrite and fread.. but what?Code:Segmentation fault (core dumped)



LinkBack URL
About LinkBacks



