Hi Friend, As i had told you, here is a general code, that can display a ASCII format Text file perfectly as same as it can be viewed in any formatted text editor like wordpad.
#include<stdio.h> // For FILE operations
#include<conio.h> // For putchar() function
pFile = fopen("test.txt","r");
if(pFile == NULL)
printf("Error opening file");
while(c != EOF)
c = fgetc(pFile);
See, it wasn't difficult at all, now the only thing you need to remember before getting perfectly fine display is:
Maximum Columns in a single Row must to 80, since in dos text mode, only 80 columns are there.
Hope it will help you. :-)
Tushar Srivastava :-)