Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Maps in C++

Name: Anonymous 2008-01-06 14:23

Anyone any good with how to access a map in C++? Any simple tips or pointers to decent websites for help would ace.

Name: Anonymous 2008-01-06 14:24

Use the Google Maps API, it allows you to do it in Javascript, which is quite close syntax-wise.

Name: Anonymous 2008-01-06 14:38

>>1
What kind of maps are you talking about ? Geographical ones ? In which format ?

Name: Anonymous 2008-01-06 14:41

maps as in the data structure in the c++ std lib

as in...

map<key_type, data_type>

Thanks >>2, but i don't think its the same thing.

Name: Anonymous 2008-01-06 15:26

                       //`'''```,
             o        // LISP   `.,
       ,....OOo.   .c;.',,,.'``.,,.`
    .'      ____.,'.//
   / _____  \___/.'
  | / ||  \\---\|
  ||  ||   \\  ||
  co  co    co co

Name: Anonymous 2008-01-06 15:39

>>1
Maps in Sepples?  Can't be done.

Name: Anonymous 2008-01-06 15:41

>>4
Are you the OP? If not, the question of asking how to access elements of an std::map seems rather dumb. Use operator [], or the find method.

Name: Anonymous 2008-01-06 15:45

>>7
Are *YOU* the OP?
Are you gay?
Are you GAY OP?

If so, gb2irc.

Name: Anonymous 2008-01-06 15:46


>>7


Yeah I posted >>4 and i'm the OP, I've tried the find method, only prob is my data type is a struct, so what i'm trying to do is access this 'userName' variable from the map ....

definetype struct{
string userName;
string hostName;
}

map<int, clientInfo>

I'm maybe being quite stupid, but i'm having trouble getting to that userName variable.

Name: Anonymous 2008-01-06 15:46

>>8
Yeah, fuck you.

Name: Anonymous 2008-01-06 15:47

>>9
first = key
second = value
The data structure stored in a map is actually an std::pair, with these data members templatized over the key and value, respectively.

Name: Anonymous 2008-01-06 15:48

>>10
/mode +b ~Anonymous@*.*

Name: Anonymous 2008-01-06 15:49

map::iterator i = mmymap.find(20);
(*i).second.userName;

Name: Anonymous 2008-01-06 15:58

with names like userName and hostName, I'm assuming you're making some sort of IRC bot. GTFO script kiddie fag

Name: Anonymous 2008-01-06 16:01

>>14
sub loop_inscription()
        repeat
                repeat
                        restock()
                        wait(1000)
                        inscribe()
                        wait(1000)
                        unloadscrolls()
                        wait(750)
                until uo.mana < 50 || uo.dead()
                meditate()
        until uo.dead()
end sub

Name: Anonymous 2008-01-06 16:04

>>15
Is that even relevant to this thread, or is just your way of calling yourself a faggot?

Name: Anonymous 2008-01-06 16:13

>>14

Nope not an IRC bot, i'm studying a module in client/server methods and just needing help on working out how to let clients send messages to each other.

>>13
>>11
Thanks for your help, looked up the std::pair and thanks for the iterator help.

Name: Anonymous 2009-03-18 3:24

I wants lots and lots of some delectable pot!

Marijuana MUST be legalized.

Name: ​​​​​​​​​​ 2010-10-21 13:37

Name: Anonymous 2010-11-14 3:42

Name: Anonymous 2010-11-27 11:44

Name: Anonymous 2011-02-03 4:09

Don't change these.
Name: Email:
Entire Thread Thread List