Does not name a type error

Here is my code(.h):
http://screensnapr.com/v/Zvlmg0.png
Here is my error:
http://screensnapr.com/v/lT5qv8.png

I included the string, so why does it not name a type?
I cannot view the images as that site is blocked for malware. Is the code and error message really so long to copy and paste into [code] and [output] tags?
Pretty bad AV if it blocked screensnapr...

Anyways:
1
2
3
4
5
6
7
8
9
10
11
12
#include <string>

class advertisement{
    public:
		int adArraySize;
		int currentAd;
		string adArray[1000]; //Set size to appropriate size...

    int findAdArraySize();
    void readAndStoreAd();
    string getAd();
};



advertisement.h:10: error: 'string' does not name a type
advertisement.h:14: error: 'string' does not name a type
advertisement.cpp:52: error: no 'std::string advertisement::getAd()' member function declared in class 'advertisement'
I'm connected through a school connection.
Anyway, you need to either use std::string (better) or put using namespace std; (worse)
So like std::string nameOfFunction?
Yes, like that. string is in the std namespace, therefore you have to use the scope resolution operator (::) to resolve the scope. ;)
Okay. Thanks very much. That resolved the problem. Really appreciated the quick response.
Another (in the middle) solution between the 2 proposed by @L B is:
using std::string;
sometimes even better since you can use string where ever you would put std::string and not include the whole std namespace at the same time.
Topic archived. No new replies allowed.