Search Result

Collapse
3 results in 0.0033 seconds.
Keywords
Members
Tags
g++
  •  

  • Imposter
    started a topic Pragma
    in C

    Pragma

    How can i use a pragma directive in order to show warning by compiler when a variable is declared twice.. That is

    class a
    {
    int b;
    void f()
    {
    int b;
    }
    };

    although it is getting compiled without warning.
    See more | Go to post

  • Easy way to Compile old g++ 2,95.3 code with newer g++ 3.4

    I have some piece of code compiled earlier with g++ 2.95.3. When I try to compile the code in new g++ version 3.4.3, the compilation fails with error
    "error: invalid in-class initialization of static data member of non-integral type `const char* const'".
    I recognize the problem. I have header files with variables initialized inside the class definition. When I move the variable initialization to class constructor, it compiles...
    See more | Go to post

  • sizeof(struct) giving unexpected sizes. Memory alignment issues?

    I noticed some quirks with C++ (not sure if this is the same for C).

    I have:

    Code:
    struct A {
        char a[14];
    };
    
    struct B {
        char b[16];
    };
    
    struct C {
        struct A a;
        struct B b;
    };
    sizeof(C) produces 32, which is mind boggling. Is the C++ compiler trying to align it to the memory structure? This is god awful for doing things...
    See more | Go to post
Working...