Hi guys,
I have found some sample code on the internet and was playing around with it in order to understand what it does, using CodeBlocks. The code is for the class is:
Code:#ifndef EUROPEANOPTION_H_INCLUDED #define EUROPEANOPTION_H_INCLUDED #include <string> class EuropeanOption { private: void init(); // Initialise all default values void copy(const EuropeanOption& o2); // 'Kernel' functions for option calculations double CallPrice() const; double PutPrice() const; double CallDelta() const; double PutDelta() const; public: // Public member data for convenience only double r; // Interest rate double sig; // Volatility double K; // Strike price double T; // Expiry date double U; // Current underlying price double b; // Cost of carry string optType; // Option name (call, put) };
However, I am getting the following error on the last line: 'string' does not use name type.
Am I calling the <string> class incorrectly? Also how does CodeBlocks add classes like string and math.h? Do I have to install them or are they already in CodeBlocks?