string class question ....

Discussion in 'C++' started by JustSomeGuy, Dec 9, 2003.

  1. JustSomeGuy

    JustSomeGuy Guest

    Sorry must repost in this thread...

    This comiles in gcc but not on vc++
    Error message is something like....
    structs.h(171) : error C2440: 'initializing' : cannot convert from 'class
    std::basic_string<char,struct std::char_traits<char>,class
    std::allocator<char> >' to 'atype'


    typedef struct
    {
    string a;
    string b;
    } atype;

    string ABC = ("123");
    string DEF = ("456");

    atype mylist[] =
    {
    {"ABC", ABC},
    {"DEF", DEF}
    };
     
    JustSomeGuy, Dec 9, 2003
    #1
    1. Advertising

  2. JustSomeGuy wrote:
    > Sorry must repost in this thread...
    >
    > This comiles in gcc but not on vc++


    vc++ is wrong.

    Are you using VC7
     
    Gianni Mariani, Dec 9, 2003
    #2
    1. Advertising

  3. JustSomeGuy

    JustSomeGuy Guest

    "Gianni Mariani" <> wrote in message
    news:br3kvr$...
    > JustSomeGuy wrote:
    > > Sorry must repost in this thread...
    > >
    > > This comiles in gcc but not on vc++

    >
    > vc++ is wrong.
    >
    > Are you using VC7
    >


    No 6.0
     
    JustSomeGuy, Dec 9, 2003
    #3
    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. Mladen Adamovic
    Replies:
    0
    Views:
    777
    Mladen Adamovic
    Dec 4, 2003
  2. Purush
    Replies:
    4
    Views:
    1,764
    Purush Rudrakshala
    Apr 13, 2005
  3. E11
    Replies:
    1
    Views:
    4,939
    Thomas Weidenfeller
    Oct 12, 2005
  4. christopher diggins
    Replies:
    16
    Views:
    784
    Pete Becker
    May 4, 2005
  5. Joseph Turian
    Replies:
    5
    Views:
    627
Loading...

Share This Page