static array of strings?

Sean Draine seandr@millisecond.com
Fri May 22 06:39:00 GMT 2009


Hi,

I'm porting a Windows app written in VC++ to the Mac and am getting a
compile error that I can't figure out. The relevant code is as follows:

//////////////////////////////////////////////
#define _T(x)      L ## x

const int NUM_VALIGNMENTS = 3;

const LPCTSTR VAlignments[NUM_VALIGNMENTS] =
{
	_T("bottom"),
	_T("center"),
	_T("top")
};
//////////////////////////////////////////////

The code generates the following compile errors at each item in the array:
- Syntax error
- expected unqualified-id before ',' token
- expected '}' before ';' token

Is there a specific issue with the syntax, the macro, or are static arrays
of strings simply not supported by gcc?

Thanks,
Sean



More information about the Gcc-help mailing list