www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Expression expected error

↑ ↓ ← 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
↑ ↓ 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
↑ ↓ → "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