D
DaveJ
Hi,
I have a small problem I'm trying to solve in C++
I have a file containing a number of usernames under a serious of
groups:
Admin
---------
Dave834
Bob
John
......
Operators
----------
George
Ray
Gavin
Garry
......
Users
---------
Dylan
Darragh
Clive
.....
Note that we can't have duplicate users names.
I have written some code that parses the file, and can read each
group, and then read all the users in that group.
I want to be able to perform a lookup on a username, and find out what
group that user belongs to. Im guessing I need to use some sort of
hash map, but haven't found anything suitable. The emphisis is on
fast reterival, does anyone have a suggestion of how this could be
implemented?
I have a small problem I'm trying to solve in C++
I have a file containing a number of usernames under a serious of
groups:
Admin
---------
Dave834
Bob
John
......
Operators
----------
George
Ray
Gavin
Garry
......
Users
---------
Dylan
Darragh
Clive
.....
Note that we can't have duplicate users names.
I have written some code that parses the file, and can read each
group, and then read all the users in that group.
I want to be able to perform a lookup on a username, and find out what
group that user belongs to. Im guessing I need to use some sort of
hash map, but haven't found anything suitable. The emphisis is on
fast reterival, does anyone have a suggestion of how this could be
implemented?