cast multimap values

Discussion in 'C++' started by scrat_here@yahoo.com, Jul 28, 2013.

  1. Guest

    Hi
    How to solve the error:

    error: invalid cast from type ‘std::pair<const std::basic_string<char>, std::vector<Procedure*> >’ to type ‘const char*’

    Many thanks
     
    , Jul 28, 2013
    #1
    1. Advertising

  2. Öö Tiib Guest

    On Sunday, 28 July 2013 09:34:32 UTC+3, wrote:
    > How to solve the error:
    >
    > error: invalid cast from type ‘std::pair<const std::basic_string<char>,
    > std::vector<Procedure*> >’ to type ‘const char*’


    By not doing what it complains about. For example you attempt to supply
    objects of type 'std::pair<std::string,std::vector<Procedure*> >' as
    arguments to a function that expects 'const char*' as parameter. It is
    illegal to do so and so compiler refuses to compile it.
     
    Öö Tiib, Jul 28, 2013
    #2
    1. Advertising

  3. Guest

    I can read the error myself...
     
    , Jul 28, 2013
    #3
  4. Guest

    I can read the error but look for a cast.
     
    , Jul 28, 2013
    #4
  5. Öö Tiib Guest

    On Sunday, 28 July 2013 13:01:59 UTC+3, wrote:
    > I can read the error but look for a cast.


    Such a cast is nonsense so it is made illegal in C++. Can you convert
    your keyboard and mouse into IP address of your PC? No? Why? Because
    it is nonsense. What you actually try to do we do not know, because
    you do not tell nor show.
     
    Öö Tiib, Jul 28, 2013
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Håvard Kverneland

    Multimap

    Håvard Kverneland, Feb 10, 2004, in forum: Java
    Replies:
    1
    Views:
    676
    Håvard Kverneland
    Feb 10, 2004
  2. John Harrison
    Replies:
    1
    Views:
    601
    Dave O'Hearn
    Aug 14, 2003
  3. MSG

    to cast or not to cast malloc ?

    MSG, Feb 6, 2004, in forum: C Programming
    Replies:
    38
    Views:
    1,114
    Dan Pop
    Feb 10, 2004
  4. EvilRix
    Replies:
    8
    Views:
    677
    Martin Dickopp
    Feb 14, 2004
  5. Pavel
    Replies:
    7
    Views:
    560
    Pavel
    Sep 19, 2010
Loading...

Share This Page