Re: Need help with my program

From: Peter Bennett (peterbb_at_interchange.ubc.ca)
Date: 10/16/03


Date: Thu, 16 Oct 2003 14:58:22 -0700

On Thu, 16 Oct 2003 15:20:52 -0500, Ed Morton
<mortonAVOIDINGSPAM@Lucent.com> wrote:

>On 10/16/2003 3:18 PM, Not Really Me wrote:
>> "Joona I Palaste" <palaste@cc.helsinki.fi> wrote in message
>> news:bmmn46$rj3$1@oravannahka.helsinki.fi...
 
>>>DarkKobold <none@thanks.com> scribbled the following
>>>on comp.lang.c:
 
>> <snip>
 
>>>> for (i = 0; i<= 7; i++)
>>>> {
>>>> if ((buffer[curr] & y) == y)
>>>> // ^^ this line is the main problem I think.

>> <snip>
 
>>>> y << 1;
 
>> Also, it appears that y is uninitialized when it is first used. It needs to
>> have a value before you use it the first time. You can't assume that it
>> starts at zero.

>Yes you can, it's static. See http://www.eskimo.com/~scs/C-faq/q1.30.html.

However, you want y to start at 1, so you still need to initialize it
immediately before entering the for() loop.

-- 
Peter Bennett VE7CEI         
GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html 
Newsgroup new user info: http://vancouver-webpages.com/nnq


Relevant Pages

  • Re: Trying to find these pins...
    ... GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html ... Newsgroup new user info: http://vancouver-webpages.com/nnq ...
    (sci.electronics.components)
  • Re: AIS Transponders on All Boats over 34 Feet?
    ... you'll see that they were all stolen from this newsgroup. ... Peter Bennett VE7CEI ... GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html ...
    (rec.boats.cruising)
  • Re: AIS Transponders on All Boats over 34 Feet?
    ... you'll see that they were all stolen from this newsgroup. ... Peter Bennett VE7CEI ... GPS and NMEA info and programs: ...
    (rec.boats.cruising)
  • Re: Pot resistance - 473 ?
    ... GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html ... Newsgroup new user info: http://vancouver-webpages.com/nnq ... Prev by Date: ...
    (sci.electronics.basics)
  • Re: Best way to label small project boxes ?
    ... email: peterbb4 interchange.ubc.ca GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html Newsgroup new user info: http://vancouver-webpages.com/nnq ...
    (sci.electronics.basics)