hi
little qur how can i dump the contents of array into a file. plz look at this
template<class T>
bool MyStorage<T>::readFromFile (char *fileName)
{
fstream fileopen("fileName",ios::in);
char arrayPtr[20];
while(!fileopen.eof())
{
fileopen.getline(arrayPtr,20);
cout<<arrayPtr<<endl;
}
fileopen.close();
return 1;
}
template<class T>
bool MyStorage<T>:
rintIntoFile (char *fileName)
{
fstream filewrite("fileName.txt",ios:
ut);
while(!filewrite.eof())
{
filewrite.put(arrayPtr);
}
filewrite.close();
return 1;
}
when i am using put function it is saying can't convert 'int' to 'char'. plz tell me what i am doin wrong.
i am working with this file.
8
7 6 3
53 23
5 3
9
little qur how can i dump the contents of array into a file. plz look at this
template<class T>
bool MyStorage<T>::readFromFile (char *fileName)
{
fstream fileopen("fileName",ios::in);
char arrayPtr[20];
while(!fileopen.eof())
{
fileopen.getline(arrayPtr,20);
cout<<arrayPtr<<endl;
}
fileopen.close();
return 1;
}
template<class T>
bool MyStorage<T>:
{
fstream filewrite("fileName.txt",ios:
while(!filewrite.eof())
{
filewrite.put(arrayPtr);
}
filewrite.close();
return 1;
}
when i am using put function it is saying can't convert 'int' to 'char'. plz tell me what i am doin wrong.
i am working with this file.
8
7 6 3
53 23
5 3
9