Possible Duplicate:
Porting a C array declaration to Delphi
I’m converting a C code to Delphi, and I want to convert a variable declaration, but I really don’t know.. Can you help?
char szImageName[BUFMAXLEN];
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Delphi equivalent is:
Take care to use
AnsiCharrather thanCharsince in modern versions of Delphi the generic typeCharis aliased to the 2 byteWideChar. Of course if you are on pre-Unicode Delphi then this warning is not pertinent.The biggest difference in the syntax is that all arrays in C have 0 as the lower bound. In Delphi you can specify whatever lower-bound you wish. Naturally to match the C code we specify 0 as our lower-bound.