473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using classes in vectors

Hey Guys,

Just before i ask this question, im not the worlds best coder and im not fond of C++ ( perhaps cus i dont understand it).
However i have this stupid assignmenti have to do, cliff notes version its a text based "tamagotchi" game on a unix box.
I have created a class called baby and the functions seem to work fine in it.We can have as many baby's as we wont in the daycare centre therefore i decided to create a vector. Vector works great, however it takes in my information about the baby but i cant get it out.

any ideas?

Thanks

Josh
Sep 18 '06 #1
1 1414
Banfa
9,065 Expert Mod 8TB
Not without a code sample since what you describe is not the behaviour of a vector.
Sep 18 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: spoc | last post by:
I have been using memcpy to copy one class to another of the same type. There are reasons why I had to do this bug am getting some odd crashes and maybe I'm doing something dodgy copying classes...
4
by: Venn Syii | last post by:
I've searched all the forums but cannot find an answer to this question. I do the following: vector<MyClass*> myClassList; Later in the program I try to add to myClassList with a...
7
by: alternativa | last post by:
Hello, I have a few questions concerning classes. 1) Why some people use default constructos, i.e constructors with no parameters? To me it doesn't make any sense, is there something I should...
7
by: toton | last post by:
Hi, I have a STL vector of of characters and the character class has a Boost array of points. The things are vector<Characterchars; and class Character{ private: array<Point,Npoints; }; Now...
2
by: Ben Wheare | last post by:
Hiya, I'm fairly new to C++, and trying to figure out how to do the following: I have a class, strings, which has a private char array. To add to this array, I call the member function...
1
by: Michael O'Brien | last post by:
Hola~ I have a large array of points (over a million). I would like to multiply each point in the array by a 4x4 matrix. I keep thinking there should be an easy way to do this using numpy, but I...
1
nabh4u
by: nabh4u | last post by:
Hi, I have a problem referencing to Vectors using pointers i.e. I am not able to use "call by reference" on vector variables. I have a "read()" function in "x.cpp" and "main()" in "y.cpp". I...
5
by: Renato | last post by:
I have an array of pointers to class Shape. I create 4 items and display their values. shapes Shape *shapes; shapes = new Shape (p1); shapes = new Triangle (p1); shapes = new Polygon (p2);
5
by: andrewmorrey | last post by:
Hello, I've got a VC++ project containing multiple classes and a main function. In one of the class functions, it reads from a text file and places the data into a vector; //...
5
by: Daniel Pitts | last post by:
I have a template: template<typename t, int foo> class MyTemplate { public: template<typename bar> MyTemplate() { bar::something(foo); } }
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.