f



ERROR IN EXPRESSION; -1 - (-1) not 1 - (-1)

The expression isn't  a = 1 - (1-), but: a = -1 - (1)
0
der (9)
7/13/2003 6:14:01 PM
comp.lang.c 30657 articles. 5 followers. spinoza1111 (3246) is leader. Post Follow

1 Replies
1367 Views

Similar Articles

[PageSpeed] 4

der <der@noemail.com> scribbled the following:
> The expression isn't  a = 1 - (1-), but: a = -1 - (1)

Ah, that's different, then. Then the answer is: The result will be -2.
You have *no* guarantees about which of -1 or (1) is evaluated first,
but as they don't have side effects, you don't have to care.

-- 
/-- Joona Palaste (palaste@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/
"To doo bee doo bee doo."
   - Frank Sinatra
0
palaste (2323)
7/13/2003 6:15:44 PM
Reply:

Similar Artilces:

How To Accessing C++ Class objects in C : getting error fatal error C1189: #error : "eh.h is only for C++!"
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be More Specific i am Creating a C++ Object in a C file... this Giving me the error!!! :( can Any Body Please Help me How to Access the C++ object in C file... Thanks In Advance :) Hi, > How to Access the C++ object in C file... Please have a look at the following page http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html Regards On Jan 7, 11:17=A0am, "sachinv1...@gmail.com" <sachinv1...@gmail.com> wrote: > hi , > i am Getting this Error > fatal error C1189: #error : "eh.h is only for C++!" > my Problem is i am Having C++ librabry and Appropriate .h file > i want to Access Them is .c File Files..... > to Be More Specific i am Creating a C++ Object in a C file... > this Giving me the error!!! :( > > can Any Body Please Help me > > How to Access the C++ object in C file... > Thanks In Advance :) In general, you can't. You can provide a procedural interface instead, and declare it in a header file like this: #ifdef __cplusplus extern "C" { #endif void some_function(int, char*, double); // or whatever #ifdef __cplusplus } #endif This can then be included from both C and C++. On Jan 7, 4:32=A0pm, tragomaskhalos <dave.du.verg...@logicacmg.com> wrote: > On Jan 7, 11:17=A0am, "...

[Urgent]: How To Accessing C++ Class objects in C : getting error fatal error C1189: #error : "eh.h is only for C++!"
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be More Specific i am Creating a C++ Object in a C file... this Giving me the error!!! :( can Any Body Please Help me How to Access the C++ object in C file... Thanks In Advance :) "sachinv1821@gmail.com" <sachinv1821@gmail.com> writes: > How to Access the C++ object in C file... > Thanks In Advance :) You'd be better off asking in comp.lang.c++. I know this sounds...

error by compiling an c-sfunction: simulink.c errors
hi! i looked around in this forum but it look's like i'm the only one with this problem. ok, i would like to mex a c-code s-function but it doesn't work. i used the "sfuntmpl_basic.c" skeleton for my programm and there is no error anymore (i think so) :-). the error message is the following: Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 syntax error; found `(' expecting `)' Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 skipping `(' `(' Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 syntax error; found `const' expecting `)' Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 redeclaration of `_ssSetInputPortMatrixDimensions' previously declared at C:\Programme\MATLAB7\simulink\include\simstruc.h 6310 Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 syntax error; found `const' expecting `{' Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 missing identifier Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 syntax error; found `)' expecting `;' Error csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 skipping `)' Warning csfunctionSystem.c: C:\Programme\MATLAB7\simulink\include\simulink.c: 198 Statement has no effect Error csfunctionSystem.c: C:\Prog...

C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression"
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" The C++ Standard (ISO/IEC 14882, Second edition, 2003-10-15) says under 6.4.2(2) [see also 5.19]: case constant-expression : I propose that the case expression of the switch statement be changed from "integral constant-expression" to "integral expression". This opens up many new possibilities since then also function calls would be permitted in the case expression. The old case case would continue to function since it is...

Expression in Turbo c/c++
I AM using turbo C compiler ver 3.0... Problem is.. int a=5,b; b = ++a * ++a; cout<<a gives output as 49. but cout<<++a * ++a; gives output as 42. WHY? Sourabh Dogra wrote: > int a=5,b; > b = ++a * ++a; > cout<<a gives output as 49. > > but cout<<++a * ++a; gives output as 42. > > WHY? Because the order of evaluation is not defined. -- www.zenobits.com Sourabh Dogra wrote: > > I AM using turbo C compiler ver 3.0... > > Problem is.. > > int a=5,b; > b = ++a * ++a; > cout<<a gives output as 49. > ...

Db2 Express C db2diag.log error
I just installed Express C and am getting the following messag erepeated every three minutes, can someone please advise or help figure out what this is. Cheers, 2006-08-09-10.58.17.218000-240 I1472H412 LEVEL: Severe PID : 1652 TID : 808 PROC : db2syscs.exe INSTANCE: DB2 NODE : 000 APPHDL : 0-74 APPID: *LOCAL.DB2.060809145817 FUNCTION: DB2 UDB, base sys utilities, sqleattach_agent, probe:60 RETCODE : ZRC=0x805C00E8=-2141454104=SQLZ_RC_INV_NAMESPACE, SQLT_SQLEX "Invalid Namespace" Seems ...

Error E0025 Error in #if expression
Hi everyone! I'm trying to upgrade from xharbour 0.99.6 to current version. I know some of you are screaming in horror, but I've tried to avoid upgrading for fear of breaking what's working. However, the time has come when I must. When compiling my code with current xharbour, I get this error on the line: #if MAKE_VERSION == PATHOLOGY_VERSION MAKE_VERSION as well as PATHOLOGY_VERSION have been defined before reaching this line. Obviously something has changed. I can't find the reason from reading the help file or searching on this ng. What am I doing wrong? Thank you,...

compile error in C++, not C
The following program compiles just fine in C, but not in C++. Can anyone explain why? I have a chunk of code that defines stuff like this in headers (without the extern) that I can not easily change. The C compiler recognizes the first foo and second foo as the same. The C++ compiler not so much. Is there a way to get this to compile in C++ without changing all the headers? int foo; int foo=1; int main(void) { return foo; } On Aug 23, 2:44 am, Tim H <thoc...@gmail.com> wrote: > The following program compiles just fine in C, but not in C++. Can > anyone explain why...

mclmcrrt710.dll error with visual c++ express
Hi I am having problem to use Matlab's standalone version. In my computer, there are Matlab R2009a and visual c++ express 2008. If I compile a .m file in Matlab and execute it, it says: "This application has failed to start because mclmcrrt710.dll was not found. Re-installing the application may fix this problem" If I execute the file in the other computer, it works well. If I execute the file in the other computer which has visual c++ 5, it works well. If I execute the file in the other computer which has visual c++ express 2008, it does not work! So I think this problem...

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta > * open source - preferable, but not 100% necessary what's wrong with using C? Friedrich > what's wrong with using C? Too low level, no built-in garbage collection. -- Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: >> what's wrong with using C? > > Too low level, Well the Smalltalk people say, have a small language and a big library. I assume C's library status beyond that of Smalltalk. > no built-in garbage collection. Use the Boehm Weisser GC. Friedrich "Kevin Albrecht" <kevin@albrecht.net> wrote in message news:<2TiYb.237892$rj7.1641209@twister.tampabay.rr.com>... > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) > ...

jython and C-c C-c
How do I get C-c C-c to work with jython? I have the jpython command set to jython, and I can start the interpreter with C-C ! and then use C-c C-c, but this is rather frustrating. If I try to use C-c C-c without first starting the interpreter in another window I get wrong type argument: sequencep, jpython Thanks, Dave Cook ...

Error migrating DB2 Express C from 9.5 to 9.71
On my XP sp3 box, I tred to upgrade my DB2 Express C 9.5 to 9.71, but I received the error SQL5055C during the DB2EXTSEC phase. Now I can't open neither the command center, nor the CLP, receiving the same SQL error. Notice that, before upgrading, I run db2ckupgrade.exe which told me that I can upgrade my DBs without problems. Thanks in advance. Bye Franco -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://www.francolombardo.net Scala, Java, As400..... http://twitter.com/f_lombardo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 3/5/2010 10:50 AM, Franco Lombardo wrote: > O...

Compiler error occurred when try to use a flexible template expression in preprocessor definesCompiler error occurred when try to use a flexible template expression in preprocessor defines
Compiler error occurred when try to use a flexible template expression in preprocessor defines When I try to compile the following codes piece under Visual C++ .net 2003, I get an error "Fatal Error C1017" typedef ::Loki::Typelist<int,::Loki::NullType> TList; #if ::Loki::TL::Length<TList>::value int x; #endif Fatal Error C1017: invalid integer constant expression The expression in an #if directive did not exist or did not evaluate to a constant. ::Loki::TL::Length<TList> is a struct some like this: struct Length{ enum { value=0}; // Indeed,the value should be the length of this Typelist(TList) } emmm. try to the following one instead: enum {value=::Loki::TL::Length<TList>::value}; #if value int x; #endif Ok! No error, no warning. However, as you see, that's badly! I do not need this extra enum value. So, Help me, please! Where is the syntax error in the former case? Thanks! Thanks! Thanks! Sorry, I typed the title twice when I copy it from word to here. Sorry. :-( snnn wrote: > Compiler error occurred when try to use a flexible template expression > in preprocessor defines > > When I try to compile the following codes piece under Visual C++ .net > 2003, I get an error "Fatal Error C1017" > > typedef ::Loki::Typelist<int,::Loki::NullType> TList; > #if ::Loki::TL::Length<TList>::value This is a preprocessor directive in which you are trying to use a construct only underst...

Error 114 in Microfocus Server Express 2.2 when calling C functions
I am running a server express 2.2 run-time on a HPUX 11 O/S. COBOL programs are linked with C functions, and in particular with OCI Oracle C functions. I have execution problem when executing some of the C functions : << error code: 114 Attempt to access item beyond bounds of memory (Signal 11) >> It seems that IF statements with null pointer in the C programs are the cause of this stop. However, previous versions of Microfocus compilers were compliant with this syntax. Do you know a run-time option or a compiler option to prevent this error ? Microfocus support is n...

Why C/C++ errors are SO obscure/devious??
Hello, I'm not a C newbie, but I'm teaching C programming (well... FIRST programming and then C) to other guys these days and it's driving me to some reflexions on the language. It's not uncommon to forget a } writing code, and at compiling time get an error 18956778 lines after the mistake, in an otherwise absolutely correct piece of code. Or, sometimes in my journeys I got errors reported in a file, checked and found it correct, and discovered it was caused by an error in another file. And in general, I noted that many, if not all, error messages from the compiler ar...

[C/C++]Write a BMP...where is the error?
Hi all I have a problem with the BMP in C++. I must save a BMP. Initially i have three square matrix (red, green and blu) of unsigned char. BMP is saved, but i don't view the image. data are saved correctly. Analizing output (result.bmp) with Matlab, i note the message "Error reading BMP data. Invalid data offset. File contains: 24 bit indexed BMP image I set the offset to 54. is it right? I studied the format BMP but i yet don't solve this problem. Help me please! I post the code ---- void Bitmap :: writeBitmap(unsigned char **r, unsigned char **g, unsigned char **b, u...

Translate C expression to Java expression
Hi, I'm attempting to translate a C function to a Java method, but I'm stuck on the two non-trivial return expressions shown below. Hoping someone here can help. Thanks, Jeff Higgins int test(double* xy1, double* xy2, double* xy3) { if (fabs(vectmult(xy1, xy2, xy3)) != 0.0) return 0; if (xy1[0] != xy2[0]) return (xy3[0] - xy2[0]) * (xy2[0] - xy1[0]) < 0.0; if (xy1[1] != xy2[1]) return (xy3[1] - xy2[1]) * (xy2[1] - xy1[1]) < 0.0; return 1; } "Jeff Higgins" <oohiggins@yahoo.com> writes: >int test(double* xy1, double* xy2, double* xy3)...

mutex error when using C function in C++
Hi, I'm using a C header and functions under a c++ class. The problem is when I call the c func, say foo(...) directly under main there is no problem, when I use it in the class VS debugger takes me to xmtx.c. MyClass::executeFoo(...) { foo(...); } int main(void) { foo(...) //no problem MyClass X; X.executeFoo(); //problem .... } Thanks in advence. pm100 wrote: > Hi, > > I'm using a C header and functions under a c++ class. The problem is > when I call the c func, say foo(...) directly under main there is no > problem, when I use it in the class...

Why this C++ library installation encounter c errors
Hi, I install SystemC on my Linux OPENSUSE. SystemC is a C++ library for system architecture, hardware simulation use. I find that the configure process generates two Makefile files under src/sync/kernel and src/sync/utils. These two Makefile have aclocal-1.6 command while my computer has aclocal 1.11. After I modify the aclocal-1.6 to aclocal, the 'make install' runs. Unfortunately, it encounters two errors after several minutes during 'make install'. The errors are: .......................... .../../../../src/sysc/utils/sc_utils_ids.cpp: In function 'int sc_c...

type error resolving infix expression -- ERROR
hi friends, i have one type of signal that contains 64 values, each value of type integer range -128 to 128. signal named as ifftre. subtype addr is integer range 0 to 63. type samp of array(addr) is integer range -128 to 128. signal ifftre : samp; subtype addr1 is integer range 0 to 79; type samp1 of array(addr1) is integer range -128 to 128 signal cp : samp1; i got on output over that signal. then i want to get an another output of last 16 values with that of 64 values, total of 80 values i get and store it in another signal. for that i concatenate both values of same signal type cp <...

Function is not available in expressions in query expression Error
Hello A person developed a Microsoft Access Solution and gave me the MDE file. When I tried to run it, I got "Function is not available in expressions in query expression 'Trim([......" Error. I learnt from the Microsoft Website and from this Group that this is problem is the result of a mismatch between the Computer where this database was developed and compiled on and the Computer where I am trying to run it. Is there a way to fix this issue without getting the original MDB file? Thank you. On Tue, 28 Aug 2007 13:37:18 -0000, elie.constantine@gmail.com wrote: If it happe...

C library errors -> C++ exceptions
System: Pentium 4, Win32, gcc 3.3.3 cygwin Does anyone know of a mechanism whereby C library functions can be made to throw a (C++) exception in case a call fails? This would obviate having to check the results of function calls individually at the point of call. I would also be nice to be able to specify that (some) floating point IEEE 754 "exceptions" throw C++ exceptions (some of the time). I note that the glibc documentation suggests that "traps" may be enabled to cause fp "exceptions" to generate a SIGFPE signal. This suggests a possible workaround whereby...

C/C++ in matlab and matlab in C/C++ ?
Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

slime C-c C-c annoyance
Does anyone have a good workaround for this problem other than: just be careful! When I've compiled a large package and slime has given me a *slime-compilation* buffer, I like to work through this buffer issue by issue, fixing the errors, warnings, etc. But If I ever press C-c C-c in the editor window while fixing an error, slime destroys the *(slime-compilation* buffer with the compilation output of C-c C-c. Jim Newton <jimka.issy@gmail.com> writes: > Does anyone have a good workaround for this problem other than: just be careful! > > When I've compiled a ...

C/C++ in MATALB or MATLAB in C/C++?
Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

Web resources about - ERROR IN EXPRESSION; -1 - (-1) not 1 - (-1) - comp.lang.c

Resources last updated: 2/25/2016 9:18:45 PM