[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Vectors

Posted on 2003-11-20
3
Medium Priority
?
296 Views
Last Modified: 2013-11-20
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 ';'
0
Comment
Question by:mfcseeker
3 Comments
 
LVL 10

Accepted Solution

by:
dkloeck earned 80 total points
ID: 9788457
u can find an example at http://www.codeguru.com/mfc/comments/5037.shtml

maybe there u can find ur problemm
0
 
LVL 13

Expert Comment

by:SteH
ID: 9788663
Do you really include <CString>? CStrings are declared in afx.h which is included with stdafx.h if you created a MFC app with the app wizard. Are you looking for a string vector?

#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;
0
 
LVL 1

Author Comment

by:mfcseeker
ID: 9788867
Silly mistake, was missing "using namespace...

Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question