سؤال

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