Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!evax!utarlg.uta.edu!c145gmk From: c145gmk@utarlg.uta.edu (GORDON KEEGAN) Newsgroups: comp.lang.c Subject: Problem with #define'd macro... Message-ID: <1991Mar20.150301.9941@evax.arl.utexas.edu> Date: 20 Mar 91 14:57:16 GMT Sender: usenet@evax.arl.utexas.edu (USENET Dummy account for GNUS and TheNews) Reply-To: c145gmk@utarlg.uta.edu Organization: The University of Texas at Arlington Lines: 29 News-Software: VAX/VMS VNEWS 1.3-4 Attempting to compile the following (fragment, but displays the problem) results in an 'invalid target for assignment' error on our VAX running VMS 5.3-1, using VAX C 3.1-051. It compiles fine if I remove the division and multiplication. Any insight posted or e-mailed would be greatly appreciated. (e-mail will be summarized...) ----------------------- begin code fragment ----------------------- #define DIV_MOD(d,r,x,y) ( y == 0.0 ? d = 0.0, r = x : d = x/y, r = x - d*y ) main() { float a,b; float remainder; float quotient; a = 5, b = 2; DIV_MOD(quotient,remainder,a,b); printf("DIV_MOD(%f,%f,%f,%f)\n", quotient, remainder, a, b); } ----------------------- end code fragment ------------------------- aTdHvAaNnKcSe ----------------------------------------------------------------------------- | Gordon Keegan || Bitnet : c145gmk@utarlg | | Systems Programmer || THEnet : UTARLG::C145GMK | | Academic Computing Services || Internet: c145gmk@utarlg.uta.edu | | University of Texas, Arlington || AT&TNet : 817-273-2208 | -----------------------------------------------------------------------------