Thread overview | |||||
---|---|---|---|---|---|
|
January 17, 2005 Expression expected error | ||||
---|---|---|---|---|
| ||||
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 |
January 18, 2005 Re: Expression expected error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Carmody | 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 > > |
January 18, 2005 Re: Expression expected error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Carmody | "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); |
Copyright © 1999-2021 by the D Language Foundation