LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-30-2005, 06:32 AM   #1
Diederick
LQ Newbie
 
Registered: Apr 2005
Posts: 25

Rep: Reputation: 15
Classes in VC++


I am using Visual Studio C++, and i want to create an array of objects. I want to use a vector to store my objects. Firstly, I have created the following in my program, between the auto generated code:

class abc{
private:
int var1;
int var2;
char var3;
public:
};

and now I want to create the vector by saying:

voctor<abc> myVector(5);

but the errors i get is:

1. syntax error: missing ';' before '<'
2. missing storage-class or type specifier.

Can you help me please, I don't know VC++ that well, and I need to solve this problem.

Thank You.
 
Old 11-30-2005, 08:55 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Re: Classes in VC++

Quote:
Originally posted by Diederick
I am using Visual Studio C++, and i want to create an array of objects. I want to use a vector to store my objects. Firstly, I have created the following in my program, between the auto generated code:

class abc{
private:
int var1;
int var2;
char var3;
public:
};

and now I want to create the vector by saying:

voctor<abc> myVector(5);

but the errors i get is:

1. syntax error: missing ';' before '<'
2. missing storage-class or type specifier.

Can you help me please, I don't know VC++ that well, and I need to solve this problem.

Thank You.
voctor<abc> myVector(5); <<im not usre what you are trying to do here

#include <vector.h>

std::vector<abc>myVector;
you may have missed the namespace qualifier out.
 
Old 11-30-2005, 11:57 AM   #3
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Or misspelled "vector"...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible uses for classes. RHLinuxGUY Programming 4 11-21-2005 11:10 PM
classes in C++ niteshadw Programming 2 07-05-2005 08:05 PM
C++ nested classes enemorales Programming 5 05-23-2005 04:40 PM
RHCE Classes ninjaz Linux - Certification 3 05-03-2005 05:23 PM
OOP (PHP) classes and extended classes ldp Programming 3 03-05-2005 12:45 PM


All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration