Having probs intializing a CString in a struct

Can't seem to get the following to intialize/compile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
	struct print
    {
    int  x; //row
    int  y; //col
    int  fid;
    CString data;
	
    char *format;
    };

	CString gSin ;
	CString CSZ("CityStZip");
	CString temp;

   struct  print form [] =
   {
	   { 30, 40, 1,data("test"), "N/A" },
	   { 30, 42, 1,temp("TEST") , "N/A" },
	   { 30, 44, 1,CString("data"),  "N/A" },
	   { 30, 50, 1,temp, "N/A" },
	   { 30, 50, 1,CSZ, "N/A" },
   
	};





I'm getting the following compiler message:


error C2440: 'initializing' : cannot convert from 'const int' to 'struct print'
No constructor could take the source type, or constructor overload resolution was ambiguous




Anyone know how I can get the struct to intialize?
In C++ "struct" and all other "user types" are "class" and all member Initialization must be located in constructor scope. See this example...
This is RIGHT:
struct Tst
{
Tst():s("asd"){};
CString s;

};
This IS not right:
struct Tst
{
CString s("ASD");
};



Topic archived. No new replies allowed.