CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: abeginner

Search: Search took 0.02 seconds.

  1. Replies
    3
    Views
    765

    Re: pupose of code

    The location pointed by "ptr" may be getting written by another thread. But why left-shift "k"?
  2. Replies
    3
    Views
    765

    pupose of code

    What's the purpose of the code:

    void wait ( int *ptr, int k) { while ((1 << k) & (*ptr) == 0) {} }
  3. Referring to previously-defined class in a namespace split acorss files

    I get a syntax error for referring to a previously defined class.


    file first.cpp
    ---------
    namespace NS {

    class C : public B {
    int m;
    }
  4. Job-offer in Hi-tech semiconductor corporation

    I have placed both short/long versions of my story/questions here.

    Short story:
    I have a job offer from a top 10 semiconductor companies in SF bay area, and after about 10 years of experience in...
  5. Replies
    10
    Views
    965

    Re: size of an object

    Fine but in a common compiler such as gcc implements it as vptr/vtbl mechanism. For gcc, does anyone know why it should not be 1 vptr but 2?
  6. Replies
    10
    Views
    965

    Re: size of an object

    Shouldn't it be a just 1 vptr, not 2?
  7. Replies
    10
    Views
    965

    Re: size of an object

    Where are non-virtual non-static member functions stored?

    where are static member functions stored?

    Why is sizeof (ABCDerived) be 24 and not 20 (if iMem do not override then 16 bytes for iMem...
  8. Re: operator delete not called for "delete" statement

    thanks ninja9578.
  9. Replies
    10
    Views
    965

    size of an object

    I read somewhere that non-virtual non-static member functions do not add to the size of a class object, but can someone tell me where they are stored in memory. Static members functions, which also...
  10. operator delete not called for "delete" statement

    I overloaded op delete in the following way, but from the output I get it seems op delete does not get called for "delete a2". Anyone knows why? Running on visual studio.
    ---
    #include <iostream>...
  11. Re: how to design to achieve a goal from scratch

    I understand that, however, my original concern is different. If someone asks you a design question, I suspect that starting out like " these are the classes and the member function", is not the...
  12. Re: how to design to achieve a goal from scratch

    what do you mean by order, order, order? and data and processes?

    Any link I can refer to quickly absorb this methodology/key steps?
  13. how to design to achieve a goal from scratch

    How is one supposed to go about thinking and doing object-oriented design for a system? If someone asks me to design some utitlity in a OO language, I would start by defining classes that I deem...
  14. error C2867: 'std::string' : is not a namespace

    I have the following statement in my vc++ code, so I could use npos instead of string::npos
    --
    using namespace std::string;
    --

    But I get the following error. Similar error is issued if I do...
  15. Replies
    15
    Views
    9,518

    Re: what changes to class lead to recompile?

    same logic: change m2 to m3
  16. Replies
    5
    Views
    829

    Re: whats wrong with the code..

    sorry not sure i follow. If a new non-POD object is added as a member say std::vector, why does memset break the code - would not std::vector member's size get included in sizeof(*this)
  17. Replies
    15
    Views
    9,518

    Re: what changes to class lead to recompile?

    Paul Mckenzie,
    Whether a ctor is correct or not depends upon what it is expected to do per design. it is not clear whether the designer expected ctor to allocate memory for long *p. If yes, then...
  18. Replies
    15
    Views
    9,518

    Re: what changes to class lead to recompile?

    nuzzle,
    (d) would recompile by the same logic as (a).

    class A {
    void a(int i, int j ) {...} // m1
    void a(int i) {..} // m2
    }

    If you add m3 to A:
  19. Replies
    15
    Views
    9,518

    Re: what changes to class lead to recompile?

    In (a) - the newly added constructor may be a candidate for constructor call among many overloaded constructors, thus becoming a viable candidate function for some constructor calls.

    class A {
    ...
  20. Replies
    15
    Views
    9,518

    Re: what changes to class lead to recompile?

    Any help, please!


    The other one was:

    whats wrong with the code..
    class T {
    public:
    T();
    private:;
  21. Replies
    5
    Views
    829

    whats wrong with the code..

    class T {
    public:
    T();
    private:;
    char c[7];
    long *p;
    };

    T::T() { memset(this, 0, sizeof(*this)); }
  22. Replies
    15
    Views
    9,518

    what changes to class lead to recompile?

    I ran into following question:

    You have a class that many libraries depend on. Now you need to modify the class for one application. Which of the following changes require recompiling all...
  23. Replies
    1
    Views
    563

    (this == &s) vs (this == s)

    Hi,
    I was trying to write overloaded == operator for string class. When I use only "s" instead of "&s" in the statement "this == &s", I get the following error. My question is: Is not "s" a...
Results 1 to 23 of 23





Click Here to Expand Forum to Full Width

Featured