Array inside an 2dimensional array

This is a discussion on Array inside an 2dimensional array within the C Programming forums, part of the General Programming Boards category; Originally Posted by vart or maybe just Code: return (byte>>bit) & 1; If I gave you the whole code (~1000 ...

  1. #16
    Registered User
    Join Date
    Mar 2008
    Posts
    8
    Quote Originally Posted by vart View Post
    or maybe just
    Code:
    return (byte>>bit) & 1;
    If I gave you the whole code (~1000 lines so far) you would make it disappear at the end with the consecutive code compression

    Thank you again...

  2. #17
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Quote Originally Posted by aserf View Post
    I wish it did... it would have made my work much easier.

    It' s a Nios II Stratix II board (for those who know) of which I can control the I/O pins. Therefore I have to create a program that will work as hardware does.
    Specifically, I use the one pin as a clock (practically by constantly changing its output from 0 to 1) and in the same time I use the other pin to send bit by bit the data synchronized with the clock. That' s why I can' t send the whole byte at once, as I'm not using an existing hardware.
    Ah. Well writing a bit-banger is a piece of cake.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #18
    Ex scientia vera
    Join Date
    Sep 2007
    Posts
    478
    Quote Originally Posted by Dave_Sinkula View Post
    The approach has portability issues. I prefer plain old bytes.
    You mean it isn't standard?

  4. #19
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    A union technically has issues with the "value of a union member other than the last one stored into" being unspecified. "The order of allocation of bit-fields within a unit" are implementation-defined.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Initializing an array inside of a structure
    By Lima in forum C Programming
    Replies: 6
    Last Post: 06-08-2009, 08:53 PM
  2. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  3. array of pointers/pointer arithmetic
    By tlpog in forum C Programming
    Replies: 18
    Last Post: 11-09-2008, 06:14 PM
  4. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-11-2004, 11:15 PM
  5. looking inside of an array
    By itld in forum C++ Programming
    Replies: 1
    Last Post: 01-06-2002, 11:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21