how to display user entered data in a list

Hi,I'm a new comer to c++.I'm creating a simple books catalog software these days.In my program users are allowed to enter following data..
book Title: (the users can enter very long book title name with spaces
i.e:The Girl with the Dragon Tattoo
Author(s):Stieg Larsson and Reg Keeland
Year:2009
Sales Price($):$8.22
how do I declare arrays for each above variable,what data types and array size should I use??

then how do I display these data in a list
i.e:The Girl with the Dragon Tattoo Stieg Larsson 1999 $10.99
Harry Potter and the Sorcerer's Stone J.K. Rowling 2008 $49.99
.....(as many as data that user enter)
pls help me out with this problem.. thanks..!!!
Hi,I'm a new comer to c++.I'm creating a simple books catalog software these days.In my program users are allowed to enter following data..
book Title: (the users can enter very long book title name with spaces
i.e:The Girl with the Dragon Tattoo
Author(s):Stieg Larsson and Reg Keeland
Year:2009
Sales Price($):$8.22
how do I declare arrays for each above variable,what data types and array size should I use??

then how do I display these data in a list
i.e:The Girl with the Dragon Tattoo Stieg Larsson 1999 $10.99
Harry Potter and the Sorcerer's Stone J.K. Rowling 2008 $49.99
.....(as many as data that user enter)
pls help me out with this problem.. thanks..!!!


Declare a struct that can hold the title, the author, the year and the price, and then either manage a dynamically created C-style array, or use one of STL's container, like an std::vector.

To display the data, you could overload operator<<, or you could just write a routine that does the displaying part.
Topic archived. No new replies allowed.