Search:

Type: Posts; User: AverageSoftware

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    3,491

    I knew someone would bite at the void main. This...

    I knew someone would bite at the void main. This code is going on a PIC chip, which is a freestanding environment. The int main rule doesn't apply there, void main is the defined entry point. ...
  2. Replies
    0
    Views
    5,711

    Ten Errors

    The following program contains, to the best of my knowledge, ten errors.

    Can you find them all? Some are easy, some are hard, and there are many things that only appear to be errors that exist to...
  3. Replies
    5
    Views
    3,491

    RFC: Brute force bitwise addition

    Just for fun, I decided to try to implement addition on a purely bitwise level. I came up with this:


    void main(void)
    {
    unsigned char num1 = 19;
    unsigned char num2 = 6;
    unsigned char sum...
  4. I never claimed the opposite. If a then b does...

    I never claimed the opposite. If a then b does not imply if b then a.
  5. Just thinking, but could I get away with the...

    Just thinking, but could I get away with the claim that:

    Given type array[10];

    array is a type *const to the first element of the array? I would think this would address any potential l-value...
  6. This is because you are arguing the wrong point. ...

    This is because you are arguing the wrong point. What I am asserting is a foo == bar problem.



    CornedBee's example is a type violation. It has nothing to do with values. If you force the...
  7. Values come from expressions. Assuming something...

    Values come from expressions. Assuming something like int array[10];, array is an expression. &array[0] is also an expression. These two expressions have the same value. I'm talking about numbers...
  8. I think you have a different meaning of value...

    I think you have a different meaning of value then I do.

    The C/C++ standards define array[index] as *((array) + (index)). In the case where index is 0, this has the same value as *array.

    That...
  9. Replies
    10
    Views
    1,734

    Not quite, with crusty old Macs the opposite...

    Not quite, with crusty old Macs the opposite problem would occur. Mac OS X is firmly in the Unix camp, as evidenced by your list.
  10. The first point I will concede, that an array is...

    The first point I will concede, that an array is a pointer to its first element, I had forgotten about some of the exceptions that you later mentioned.

    However, the statement that array is...
  11. I don't buy it. m_vertex_array[0] evaluates to...

    I don't buy it.

    m_vertex_array[0] evaluates to *(m_vertex_array + 0)
    &m_vertex_array[0] is therefore &*(m_vertex_array + 0)
    The &* cancels out, leaving m_vertex_array + 0
    m_vertex_array + 0 =...
  12. Replies
    18
    Views
    2,506

    Yes, and a union can as well.

    Yes, and a union can as well.
  13. A pointer to the first element of the array is a...

    A pointer to the first element of the array is a pointer to the array itself.

    m_vertex_array and &m_vertex_array[0] are equivalent statements.
  14. Replies
    3
    Views
    1,355

    Slackware 12.0 defaults to 32 processors, I...

    Slackware 12.0 defaults to 32 processors, I believe.

    Slackware is an almost "pure" distro when it comes to source code, so rebuilding the kernel for more than 32 processors would be trivial.
  15. Replies
    14
    Views
    2,495

    The first step is always to determine whether...

    The first step is always to determine whether it's software or hardware, random restarts could be either.

    Download and burn a Knoppix CD. Boot it in your system, play with Linux for a few hours. ...
  16. Replies
    18
    Views
    2,506

    Since Node is an implementation detail of LL, I...

    Since Node is an implementation detail of LL, I would make it a private datatype of LL.

    class LL
    {
    /* stuff */
    private:
    struct Node
    {
    int val;
    Node *next;
  17. How about giving the user class a static parser...

    How about giving the user class a static parser object?

    class user
    {
    private:
    static parser yournamehere;
    };
  18. Replies
    20
    Views
    5,271

    One dual PowerMac G5 running Mac OS X One iBook...

    One dual PowerMac G5 running Mac OS X
    One iBook G4 running Mac OS X
    One PowerMac G4 Server running Slackware Linux 11
    One homemade dual Athlon MP running Slackware 12 and Windows XP
    One homemade...
  19. Replies
    20
    Views
    5,271

    I run a five computer network at home (three...

    I run a five computer network at home (three Macs, three Linux, one Windows) and I find that FTP is the most reliable way to get everyone playing together from a file sharing perspective.
  20. Replies
    8
    Views
    1,977

    The copy construction code is really quite...

    The copy construction code is really quite trivial, the class is a dynamic matrix wrapper.

    I'm just always looking for ways to slim down the code, and this looked like a possibility.
  21. Replies
    8
    Views
    1,977

    Yes, but that doesn't work in the actual...

    Yes, but that doesn't work in the actual application. I need a deep copy.

    Like I said, I assumed that this wasn't possible, so my real project has both a copy constructor and the templated...
  22. Replies
    15
    Views
    2,513

    When you have two classes that refer to each...

    When you have two classes that refer to each other, that won't work. Consider this:


    //class1.h
    #include "class2.h"

    //end class1.h

    //class2.h
    #include "class1.h"
  23. Replies
    15
    Views
    2,513

    I don't see any reason why that would need const....

    I don't see any reason why that would need const. What compiler are you using?
  24. Replies
    15
    Views
    2,513

    Assuming these are in the same file, arrange them...

    Assuming these are in the same file, arrange them like so:


    class something;

    class awful {
    public:
    awful(void);
    ~awful(void);
  25. Replies
    15
    Views
    2,513

    I reckon you need a forward declaration. Try...

    I reckon you need a forward declaration.

    Try putting this before class bar:

    class foo;
Results 1 to 25 of 142
Page 1 of 6 1 2 3 4