Hi.. can anyone help me.. I having problems in displaying the output read from an input file. when I run the code, it only display the output of the first character in the input file. Anyone can help me figure out the problem? & I'm using borland.
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <conio.h>
int main ()
{
int character;
int count = 0;
ifstream inputFile;
char fileName[100];
cout<<"Enter file name :";
cin>>fileName;
inputFile.open(fileName);
if (!inputFile)
cout<<"Eror opening file. File name "<<fileName<<" does not exist."<<endl;
else
{
while (count <= 99)
{
inputFile >> character;
cout<<character<<endl;
count++;
}
}