Advertisement Jump to content
Sign in to follow this  
Samsonite

Why wont my writeToLog function work?

This topic is 4917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Thanks for taking time reading this:
void openLogFile(char* wich, ofstream* filehandle, bool* binary)
{
     if(binary)
     {
               filehandle.open(wich,ios::out,ios::binary);
               
     }else     {filehandle.open(wich,ios::out);}
}



Well, thats my function for opening my log file. The errors returned are as follows:
C:\Dev-Cpp\Heavy prog\heavymain.cpp In function `void openLogFile(char*, std::ofstream*, bool*)': 
15 C:\Dev-Cpp\Heavy prog\heavymain.cpp `open' has not been declared 
15 C:\Dev-Cpp\Heavy prog\heavymain.cpp request for member of non-aggregate type before '(' token 
17 C:\Dev-Cpp\Heavy prog\heavymain.cpp `open' has not been declared 



EDIT:Well, acctually many others have also been returned. But its for my writeToLog and closeLogFile functions, and the errors are much the same. I know it has to do with "filehandle" but i'm not sure how to fix it! Any help is appreciated! Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Thats wonderfull!Thanks!

I forgot that ofstream is a class

EDIT: Didn't solve the problem though. Now i get:


15 C:\Dev-Cpp\Heavy prog\heavymain.cpp no matching function for call to `std::basic_ofstream<char, std::char_traits<char> >::open(char*&, const std::_Ios_Openmode&, const std::_Ios_Openmode&)'

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!