www.digitalmars.com         C & C++   DMDScript  

c++ - Expression expected error

reply Kevin Carmody <Kevin_member pathlink.com> writes:
Hello everyone,

Thank you for the nice C compiler.  I'm an experienced DOS programmer that has
moved on to another career.  I have done only a little C programming, and there
is a lot I don't know about C.  However, I have successfully tweaked some other
people's C programs with DMC.  

I'm now stymied by a DMC error.  The program I'm trying to modify has the
following line, which I did not write, and whose syntax I don't recognize or
understand.  Below it is the DMC error.  I'm using DMC v8.41n.

fixconj(X{63, 63, 113}, X{63, 34, 0});
^
devnag.c(1901) : Error: expression expected

Can anyone tell me what the braces in this statement mean, and why DMC rejects
it?  

TIA for your help.

Kevin
Jan 17 2005
parent reply Kevin Carmody <Kevin_member pathlink.com> writes:
Some clarifications of my earlier message.  First, leading spaces were
unexpectedly stripped from my message.  The caret should have been under the
first left brace, like this:

fixconj(X{63, 63, 113}, X{63, 34, 0});
........^
devnag.c(1901) : Error: expression expected

Second, there is a #define directive which appears to be involved:

#define X (short[])

and fixconj is declared as follows:

void fixconj(short *wrong, short *right);

Kevin


In article <cshbrc$2h8g$1 digitaldaemon.com>, Kevin Carmody says...
Hello everyone,

Thank you for the nice C compiler.  I'm an experienced DOS programmer that has
moved on to another career.  I have done only a little C programming, and there
is a lot I don't know about C.  However, I have successfully tweaked some other
people's C programs with DMC.  

I'm now stymied by a DMC error.  The program I'm trying to modify has the
following line, which I did not write, and whose syntax I don't recognize or
understand.  Below it is the DMC error.  I'm using DMC v8.41n.

fixconj(X{63, 63, 113}, X{63, 34, 0});
^
devnag.c(1901) : Error: expression expected

Can anyone tell me what the braces in this statement mean, and why DMC rejects
it?  

TIA for your help.

Kevin
Jan 17 2005
parent "Jackson A. Marshall" <nospam nospam.org> writes:
"Kevin Carmody" <Kevin_member pathlink.com> wrote in message
news:cshv2f$3eq$1 digitaldaemon.com...
 Some clarifications of my earlier message.  First, leading spaces were
 unexpectedly stripped from my message.  The caret should have been under the
 first left brace, like this:

 fixconj(X{63, 63, 113}, X{63, 34, 0});
 ........^
 devnag.c(1901) : Error: expression expected

 Second, there is a #define directive which appears to be involved:

 #define X (short[])

 and fixconj is declared as follows:

 void fixconj(short *wrong, short *right);

 Kevin
Maybe with the original compiler you could do this ;) but usually you cannot initialise arrays this way. short wrong[] = {63, 63, 113}; short right[] = {63, 34, 0}; ... fixconj(wrong, right);
Jan 18 2005