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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    3
    Views:
    15,304
    Mladen Adamovic
    Dec 5, 2003
  2. Matt
    Replies:
    3
    Views:
    738
    Tor Iver Wilhelmsen
    Sep 17, 2004
  3. Bruce Sam
    Replies:
    15
    Views:
    8,557
    John C. Bollinger
    Nov 19, 2004
  4. Purush
    Replies:
    4
    Views:
    2,481
    Purush Rudrakshala
    Apr 13, 2005
  5. E11
    Replies:
    1
    Views:
    5,665
    Thomas Weidenfeller
    Oct 12, 2005
  6. =?Utf-8?B?UmFqZXNoIHNvbmk=?=

    'System.String[]' from its string representation 'String[] Array'

    =?Utf-8?B?UmFqZXNoIHNvbmk=?=, May 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,972
    =?Utf-8?B?UmFqZXNoIHNvbmk=?=
    May 4, 2006
  7. christopher diggins
    Replies:
    16
    Views:
    1,019
    Pete Becker
    May 4, 2005
  8. Joseph Turian
    Replies:
    5
    Views:
    843
Loading...