string class question ....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JustSomeGuy

    string class question ....

    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_stri ng<char,struct std::char_trait s<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}
    };



  • Gianni Mariani

    #2
    Re: string class question ....

    JustSomeGuy wrote:[color=blue]
    > Sorry must repost in this thread...
    >
    > This comiles in gcc but not on vc++[/color]

    vc++ is wrong.

    Are you using VC7

    Comment

    • JustSomeGuy

      #3
      Re: string class question ....

      "Gianni Mariani" <gi2nospam@mari ani.ws> wrote in message
      news:br3kvr$nnc @dispatch.conce ntric.net...[color=blue]
      > JustSomeGuy wrote:[color=green]
      > > Sorry must repost in this thread...
      > >
      > > This comiles in gcc but not on vc++[/color]
      >
      > vc++ is wrong.
      >
      > Are you using VC7
      >[/color]

      No 6.0


      Comment

      Working...