Вопрос

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