Re: Need help with my program
From: Peter Bennett (peterbb_at_interchange.ubc.ca)
Date: 10/16/03
- Next message: Mark Tarka: "Re: Fun and Mental; Raisin for High; Achievements of Shoes"
- Previous message: cody: "Re: why still use C?"
- In reply to: Ed Morton: "Re: Need help with my program"
- Next in thread: Eric Sosman: "Re: Need help with my program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Mark Tarka: "Re: Fun and Mental; Raisin for High; Achievements of Shoes"
- Previous message: cody: "Re: why still use C?"
- In reply to: Ed Morton: "Re: Need help with my program"
- Next in thread: Eric Sosman: "Re: Need help with my program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|