I was told you can access the index of an array and save it in a variable. Like, as you know, every element is referenced by an index number. 0,1,2,3,4 etc.. I don't want to save the content, I need the index number. I will need to know the position of each element later in the program. I need to know where it is.I'm not sure if I'm explaining it correctly. Anyway, how do I do this?
XodoX
0
Junior Poster in Training
Recommended Answers
Jump to PostSo let me get this right. Uhh you want to check the position of specific values in the array and keep track of their position?
I'd probably use std::multimap from the <map> header.
int TestArray[11] = {3, 9, 5, 1, 4, 2, 7, 8, 11, 10, …
Jump to PostRead a file into a vector.. For each line in the file, add it to the tracker and keep track of it's index.
Example File:
Start Word 1 Word 2 Word 3 Word 4 End
It doesn't ignore the "Start" and "End" which you can remove …
All 8 Replies
triumphost
120
Posting Whiz
XodoX
0
Junior Poster in Training
triumphost
120
Posting Whiz
XodoX
0
Junior Poster in Training
triumphost
120
Posting Whiz
XodoX
commented:
Thank you
+2
XodoX
0
Junior Poster in Training
Lucaci Andrew
140
Za s|n
triumphost
120
Posting Whiz
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.