0

I created this function for my program :

int calcTotal()
{
	petShop p;
	fstream f1;
	f1.open("Pet_Shop.dat",ios::app|ios::binary);
	int loc;
	loc=p.tellp();
	float records;
	records=loc/sizeof(p);
	cout<<"Total number of records = "<<records;
	cout<<"Going back to main menu";
	menu();
}

I am getting this error :

error C2039: 'tellp' : is not a member of 'petShop'

Isn't the tell() function available in <fstream> libaray?
Anyways, how do I fix it?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dhruv_arora
0

>error C2039: 'tellp' : is not a member of 'petShop'

Yes. Its a member of fstream[/B.


loc=f1.tellp();
0

>error C2039: 'tellp' : is not a member of 'petShop'

Yes. Its a member of fstream[/B.


loc=f1.tellp();

Thanks. Problem Solved.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.