This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

static array of strings?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]