Re: equality and errors

From: marvin (scary_at_movie.com)
Date: 12/12/03


Date: Fri, 12 Dec 2003 00:06:31 -0500

thanks aric !

exactly what i needed. the code you provided is easier to follow and i will
use it.

it was this line that confused me
set fail [catch { $first < 1} range1]

in C++ if you have this code below, it will output zero to the screen when
you run it.
2 < 1; is also a valid statement in C++ and returns 0 without being assigned
to any variable.

i will use an if statement when i evaluate conditionals from now on.
thanks again,
marvin

#include <iostream>
using namespace std;

int main()
{
    int a;

 a = 2 < 1;

 cout << a;

   return 0;
}



Relevant Pages

  • Re: input and output questions about file
    ... using namespace std; ... junk.c:5: warning: type defaults to `int' in declaration of `std' ... junk.c:10: `string' undeclared ... junk.c:12: parse error before '/' token ...
    (comp.lang.c)
  • Re: Comparing files (Fast)
    ... I didn't knew what is was, but using fseek solved the problem. ... I'm using a timer utility Scott Meyers wrote for use ... > using namespace std; ... > int ch1,ch2; ...
    (comp.lang.cpp)
  • Re: return memory to the OS
    ... > 4 using namespace std; ... > 5 int main ... > possible to make STL return this memory to the OS (say using a system ... :: "out of confusion comes chaos -- out of chaos comes confusion and fear ...
    (comp.lang.cpp)
  • Re: Huge Floating Point Error
    ... using namespace std; ... int main ... floating point math is different from integer math. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: New to c++.net (need help)
    ... > using namespace std; ... > int main ... Here's a hint for when ... your program is behaving other than how you expect, ...
    (alt.comp.lang.learn.c-cpp)