Message Board


Message Board > C/C++ > assigning vectors

March 18, 2006, 15:46
DTM
Earthling!
821 posts

Can they be assigned? when in a class?

class woo{
vector <int> la;
};

woo woo1;
woo woo2;

woo1=woo2;

:what:

or is it like pointers where only the reference gets copied?

[Edited on March 18, 2006 by DTM]
____________
:o
#
March 19, 2006, 14:55
Eckolin
Quite Whiskered
388 posts

Is a vector a primitive type?
____________
Maker of Games...
Wisdom is supreme; therefore get wisdom.
Need help with coding? I probably wrote something similar.
#
March 19, 2006, 17:05
PEader
お前はもう死んでいる
1486 posts

Quoting Eckolin:
Is a vector a primitive type?

A vector is a template in the standard template library. I'd say it copies the class but the easiest thing to do is create your own copy function. i'ts not hard to test either.
____________
I see 57,005 people.
#
March 20, 2006, 16:31
DTM
Earthling!
821 posts

Okay thanks for the suggestions.
____________
:o
#
April 18, 2006, 16:52
Rhovanion
Exterminated
666 posts
about your code: basically you just move a pointer no?
____________
#

Message Board > C/C++ > assigning vectors

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!