Re: division by zero not an error for cc?
Re: division by zero not an error for cc?
- Subject: Re: division by zero not an error for cc?
- From: Boz Jennings <email@hidden>
- Date: Thu, 20 Sep 2001 08:54:47 -0700
Thanks for all the feedback.
I have run this and got output, "result is 0".
Originally the code was more like...
int main(void) {
int result, value = 0;
result = 1 / value;
printf( "%s%d\n",
"result is ", result );
return 0;
}
... maybe I went to far simplifying it before posting.
Which all leads me to believe that maybe I need to look it up in the
ANSI standard. Is it available online somewhere? -- This all arose from
a C course I'm taking. The instructor says my machine, compiler or
something is whacked. Obviously, I'd love to prove him wrong! ;+)
Peace,
boz (AKA Christofer Jennings)