• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unobvious coding error in C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unobvious coding error in C


  • Subject: Re: Unobvious coding error in C
  • From: Óscar Morales Vivó <email@hidden>
  • Date: Tue, 28 Dec 2004 16:32:20 -0500

You know you've done too much C when... it doesn't seem an unobvious error to you :P

On Dec 28, 2004, at 13:34 , Alberto Ricart wrote:



On Dec 27, 2004, at 6:47 PM, Alex Majora wrote:


Just for fun, here's a code snippet demonstrating a somewhat unobvious coding error in C that one of our programmers made today (just goes to show you what 1 week off can do to a mind!):

#include <stdio.h>
int main()
{
 int j, k;
 . . .
 k = 90;  // some assignment of k
 . . .
 // loop 5 times max, or until k >= 100
 for (j=0;j<5,k<100;j++,k++) {

The eval should be j < 5 && k < 100, right now there's only one eval, k < 100.

/a

_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Unobvious coding error in C
      • From: Phil <email@hidden>
  • Prev by Date: NSToolbar not overflow menu delegates
  • Next by Date: Re: Illustrator to NSBezierPath
  • Previous by thread: NSToolbar not overflow menu delegates
  • Next by thread: Re: Unobvious coding error in C
  • Index(es):
    • Date
    • Thread