Storing lists using char arrays

Hello,
I'm trying to create a basic shopping cart application that allows the user to enter in a product and its price which is then echo'd to the user. Once they are done adding all the products and they want to check out it tells them how much they've spent.
The problem is that I can't use strings I need to I can only use cstrings and char arrays. I have the basic formatting down but am getting stuck on how I relay the char array back to the user with its price.

-Thanks in advance
If you need any help, I'm afraid you need to be much more specific and provide the problematic code.
I know this is a long post
http://www.cplusplus.com/forum/beginner/1/
but following its directions you're much more likely to get valuable answers.

Good luck with your code.
Is there anything else you can't use?

Normally you could create a class Product with name and price.
To store all the products you could use a vector<Product>
Last edited on
there are plenty of library functions that manage character arrays,
http://www.cplusplus.com/reference/cstring/

anything you can do with a std::string you can also do with character arrays (thats what a std::string is underneath).

for outputting i prefer printf() but other methods exist, have a read through what the functions can do for you and it will give you some ideas and maybe some more specific questions.
http://www.cplusplus.com/reference/cstdio/printf/?kw=printf
Topic archived. No new replies allowed.