I'm having trouble writing an array program that deletes duplicate numbers in an array. I can't figure out the code for find the array size. I have the array max set to 25 but my array doesn't have 25 numbers in it. (let's say it only has 10 numbers in it) What would be the C++ code to count only the numbers in the array instead of continuing all the way to 25?
express690
0
Newbie Poster
Recommended Answers
Jump to PostYou'll need a second array to hold whether the corresponding elements have been found or not. If you're super-tight on memory (unlikely) you can use bit arrays, but a simple bool array will work just fine.
All 2 Replies
Reply to this topic
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.