i am totally new to the c++ arena.
i have been tasked with writing a program that asks for a number, asks for that many names, in the form, "last, first," sorts the names by last name, but displays them in the form, "first, last," then offers the user the chance to search for a first name.
i don't want someone to do it for me, but i am having trouble getting started.
i know i need a multi-dimensional array system.
how do i initialize it if i don't know how many names there will be?
if i want to write a sort function, how to i call a multi-dimensional array and return a new array from it?
this project has inspired me to switch majors.
sjewenp
0
Newbie Poster
Recommended Answers
Jump to PostTo be able to help you best we need to know what tools you have available. For example if you don't know the first thing about the Standard Template Library then Ancient Dragon's solution isn't going to help much.
If you don't know STL then you'll need to use …
Jump to PostI agree with the struct/class recommendation, but if you don't know how to use them you can still solve the problem. Using a vector of vectors or multidimensional array or "parallel" vectors (or arrays) would all do the trick, but not as smooth as using a vector (or array) of …
All 8 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Lerner
582
Nearly a Posting Maven
SpS
commented:
Good ~SpS
+3
sjewenp
0
Newbie Poster
iamthwee
Lerner
582
Nearly a Posting Maven
iamthwee
commented:
good advice
+11
sjewenp
0
Newbie Poster
iamthwee
Lerner
582
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.