string class question ....

J

JustSomeGuy

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}
};
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top