I have three files: main.cpp, MathInputManip.h, and MathInputManip.cpp. The prob
ID: 3621416 • Letter: I
Question
I have three files: main.cpp, MathInputManip.h, and MathInputManip.cpp. The problem is that in the MathInputManip.h file the string isn't being recognized. I'm using Netbeans with newest cygwin compiler
main.cpp:
#include <iostream>
#include "MathInputManip.h"
using namespace std;
using Math_axross60944::MathInputManip;
int main() {
MathInputManip obj;
obj.getT();
return 0;
}
MathInputManip.h:
#ifndef MATHINPUTMANIP_H
#define MATHINPUTMANIP_H
#include <string>
using namespace std;
namespace Math_axross60944 {
class MathInputManip {
private:
String input; //This is where the error is being highlighted
public:
MathInputManip();
void getT();
};
}
#endif /* MATHINPUTMANIP_H */
MathInputManip.cpp
#include "MathInputManip.h"
#include <iostream>
#include <cassert>
#include <string>
using namespace std;
namespace Math_axross60944 {
MathInputManip::MathInputManip() {
input = "Test";
}
void MathInputManip::getT() {
cout << input << endl;
}
}
Explanation / Answer
The string object is string not String