delorie.com/archives/browse.cgi | search |
From: | "John" <fubu36 AT stny DOT rr DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
References: | <jrnK4.4389$4W3 DOT 69583 AT typhoon DOT nyroc DOT rr DOT com> |
Subject: | Re: vectors |
Lines: | 35 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 5.00.2919.6600 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2919.6600 |
Message-ID: | <x3pK4.3788$GP3.43651@typhoon.nyroc.rr.com> |
Date: | Sun, 16 Apr 2000 20:06:53 GMT |
NNTP-Posting-Host: | 24.95.139.17 |
X-Complaints-To: | abuse AT stny DOT rr DOT com |
X-Trace: | typhoon.nyroc.rr.com 955915613 24.95.139.17 (Sun, 16 Apr 2000 16:06:53 EDT) |
NNTP-Posting-Date: | Sun, 16 Apr 2000 16:06:53 EDT |
Organization: | Time Warner Road Runner - Binghamton NY |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
and can someone give me nd example of the copy constructer I would need to use, I can't seem to get one to work. Thanks "John" <fubu36 AT stny DOT rr DOT com> wrote in message news:jrnK4.4389$4W3 DOT 69583 AT typhoon DOT nyroc DOT rr DOT com... > I need a little help doing something > What I want to do is this > > class student > { > // i know all this shouldn't be public but for this > // example it is > char studentName[20]; > vector<int> grade; > } > > int main() > > vector<student> mathClass(10); > cout<<"size of student "<<student.size()<<"size of > grade "<<student.grade.size()<<endl; > return 0; > } > this code gives me an error of " 'class vector <student,allocator student> >' has no member named 'grade' > whats wrong with this and how would i set the vector grade in class student to start with something like 15 elements? I know this is something that would need to be done in the classes constructer but how? > > Thanks! > > >
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |