mfcseeker
asked on
Vectors
Hi,
I am trying to declare a vector of type CSrting in my dialog. But I am gettting errors.
I already included #include <vector> and #include <CString> in my header file.
//ProgramDlg.h
class CProgramDlg : public CDialog
{
public:
CProgramDlg(CWnd* pParent = NULL);
vector<CString> database;
//When I compile, I get the following error
syntax error : missing ';' before '<'
'vector' : missing storage-class or type specifiers
syntax error : '<'
unexpected token(s) preceding ';'
I am trying to declare a vector of type CSrting in my dialog. But I am gettting errors.
I already included #include <vector> and #include <CString> in my header file.
//ProgramDlg.h
class CProgramDlg : public CDialog
{
public:
CProgramDlg(CWnd* pParent = NULL);
vector<CString> database;
//When I compile, I get the following error
syntax error : missing ';' before '<'
'vector' : missing storage-class or type specifiers
syntax error : '<'
unexpected token(s) preceding ';'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Silly mistake, was missing "using namespace...
Thanks
Thanks
#include <vector>
#include <string>
using namespace std;
vector<string> database;
Or in your code you should use std:: for scope resolution:
#include <vector>
[snip]
std::vector<CString> database;