the programme is not compiling &&& showing only a single error tht i culdn't understood.have seen the code many times but i couldn't found the error........ pLz heLp me !!!!!
the eror shOwing in compiler iz:
307 C:\Users\biLmLik\Desktop\fiLe hAndLing.cpp no matching function for call to `std::basic_fstream<char, std::char_traits<char> >::open(const char[10], bool)'
#include<iostream>
#include<fstream.h>
usingnamespace std;
fstream bfile; //fstream will take bOth if & of stream there4 b(both)file
main()
{
char bchar; //bchar charactrdecLared
//fiLe opened fOr bOth input &&& putput
bfile.open("bothh.txt",ios::in || ios::out);
if(!bfile) //errOr hAndLing
{
cout<<"errOr occured";
}
for(bchar='A';bchar<='Z';bchar++)//Loop run tO write aLphabats
{
bfile<<bchar; //inserting frOm bchar tO bfile
}
bfile.seekg(8l,ios::beg);//seeks 8th character $ mOve fOrward in a fiLe
bfile>>bchar; //
cout<<"the 8th aLphabet iz "<<bchar;
bfile.seekg(-16l,ios::end);
bfile>>bchar;
cout<<"the 8th aLphabet iz "<<bchar;
bfile.close();
system("pause");
}
#include<iostream>
#include<fstream>//standard library is fstream not fstream.h
usingnamespace std;//good going
int main()//main should return a value
{
fstream bfile; //fstream will take bOth if & of stream there4 b(both)file
char bchar; //bchar charactrdecLared
//fiLe opened fOr bOth input &&& putput
bfile.open("bothh.txt",ios::in || ios::out);
if(!bfile) //errOr hAndLing
{
cout<<"errOr occured";
}
for(bchar='A';bchar<='Z';bchar++)//Loop run tO write aLphabats
{
bfile<<bchar; //inserting frOm bchar tO bfile
}
bfile.seekg(8l,ios::beg);//seeks 8th character $ mOve fOrward in a fiLe
bfile>>bchar; //
cout<<"the 8th aLphabet iz "<<bchar;
bfile.seekg(-16l,ios::end);
bfile>>bchar;
cout<<"the 8th aLphabet iz "<<bchar;
bfile.close();
//system("pause");//never ever use this again.. :O
}
return 0;
#include<iostream>
#include<fstream>
usingnamespace std;
int main()
{
fstream bfile; //fstream will take bOth if & of stream there4 b(both)file
char bchar; //bchar charactrdecLared
//open for writing
bfile.open("bothh.txt",ios::out);
if(!bfile) //errOr hAndLing
{
cout<<"errOr occured";
}
for(bchar='A';bchar<='Z';bchar++)//Loop run tO write aLphabats
{
bfile<<bchar; //inserting frOm bchar tO bfile
}
bfile.close();
return 0;
}