Hi ... First of all here is my code:
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
int j;
fstream datafile;
char name[81];
datafile.open("demofile.txt",ios::in);
if(!datafile)
{
cout << "File open error!"<<endl;
return 0;
}
while(!datafile.eof())
{
datafile >> name;
for (j = 0; j < 1; j++){
if((name[j] >= 'a') && (name[j] <= 'z')){
*name = toupper(*name);
}
}
cout << name;
}
datafile.close();
cout << "\nDone.\n";
return 0;
}
This code runs perfectly fine , i hve a small problem ... the string which i'm suppose to get as an output is: "Hello. My name is Joe. What is your name ?"
And i'm gettin' :"Hello.MyNameIsJoe.WhatIsYourName?"
Why is it doin' this ??
Please help ..
Thanxs.