Search Results

Search found 2 results on 1 pages for 'palm3d'.

Page 1/1 | 1 

  • C++ cast syntax styles

    - by palm3D
    A question related to Regular cast vs. static_cast vs. dynamic_cast: What cast syntax style do you prefer in C++? C-style cast syntax: (int)foo C++-style cast syntax: static_cast<int>(foo) constructor syntax: int(foo) They may not translate to exactly the same instructions (do they?) but their effect should be the same (right?). If you're just casting between the built-in numeric types, I find C++-style cast syntax too verbose. As a former Java coder I tend to use C-style cast syntax instead, but my local C++ guru insists on using constructor syntax. What do you think?

    Read the article

  • What are the differences between struct and class in C++

    - by palm3D
    This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a struct and a class in (unmanaged) C++. Please discuss the technical differences as well as reasons for choosing one or the other in OO design. I'll start with an obvious difference: If you don't specify public: or private:, members of a struct are public by default; members of a class are private by default. I'm sure there are other differences to be found in the obscure corners of the C++ specification.

    Read the article

1