c++ - Expression expected error
- Kevin Carmody (15/15) Jan 17 2005 Hello everyone,
- Kevin Carmody (12/27) Jan 17 2005 Some clarifications of my earlier message. First, leading spaces were
- Jackson A. Marshall (7/18) Jan 18 2005 Maybe with the original compiler you could do this ;) but
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
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
"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); KevinMaybe 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