문제

How does one go about defining methods in a header file that accept either an fstream or ifstream as a paramater?

#include <fstream>
#include <string>

class hw4
{

        public:
                // Methods
                char* cFlagCheck(char* logfile, fstream& f);
                int sFlagCheck(char* set, fstream& f, ifstream& cpy, int &R, int &X, int &Y);
                void* runRobot(void* robotCount);
};
도움이 되었습니까?

해결책

You need to prepend the class names with the std namespace ie. std::ifstream

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top