cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Vector c++
Vector c++
Apr 6, 2020 at 7:14pm
Apr 6, 2020 at 7:14pm UTC
amy119s
(7)
I have program that contains Class Book and Class News.
I need to create a vector library in main program that should contain pointers to objects of the Book and News type. Does someone knows how can i start with this?
Last edited on
Apr 6, 2020 at 7:15pm
Apr 6, 2020 at 7:15pm UTC
Apr 7, 2020 at 9:21am
Apr 7, 2020 at 9:21am UTC
Handy Andy
(5051)
Hello amy119s,
You could start with
http://www.cplusplus.com/reference/vector/vector/?kw=vector
Then there is
https://www.learncpp.com/
chapter P or
https://www.learncpp.com/cpp-tutorial/6-16-an-introduction-to-stdvector/
Your question poses more questions?
Do you have to use a vector of pointers? Is it required?
What does the class look like?
What code are you working with? And what have you done so far?
Are you new to vectors or so you have some experience?
Post what code you have so far. Right now I can only guess at what you have and what you can use or might need.
If the program reads a file include it or at least a good sample, say 5 to 10 records, so everyone will have the same information to work with.
Andy
Topic archived. No new replies allowed.