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

Search:

Type: Posts; User: 2kaud

Search: Search took 0.04 seconds.

  1. Replies
    31
    Views
    2,013

    Re: using namespace std

    When writing a class that uses dynamic memory, then you provide as a minimum

    - default constructor
    - other constructor(s) as required
    - destructor
    - copy constructor
    - copy assignment
    - move...
  2. Replies
    31
    Views
    2,013

    Re: using namespace std

    The 'correct' modern c++ way to not allow copy constructor/operator = is



    public:
    Schedario(const Schedario&) = delete;
    Schedario& operator=(const Schedario&) = delete;
  3. Replies
    31
    Views
    2,013

    Re: using namespace std

    Ask 10 experienced c++ programmers to write a program and you'll probably get 10 different programs that look different but perform the same task.... Once we become experienced, we tend to develop...
  4. Replies
    31
    Views
    2,013

    Re: using namespace std

    You could always code the copy constructor as an exercise. And if you do, also code a class swap function to swap the contents of two Schedario objects. Once you have these (together with the...
  5. Replies
    31
    Views
    2,013

    Re: using namespace std

    That is the 'old' way of dis-allowing the object to be copied. The modern way is



    public:
    Seggio(const Seggio&) = delete;
    Seggio& operator=(const Seggio&) = delete;


    Classes that use...
  6. Replies
    31
    Views
    2,013

    Re: using namespace std

    It doesn't.



    Yes, but don't. You shouldn't assume that a particular #include also includes another #include. Put the required #includes in the .h and .cpp files. The exception to this is when...
  7. Replies
    31
    Views
    2,013

    Re: using namespace std

    using namespace std was in the original compito.h because compito.h uses ostream from <iostream>. It's not good practice to have using ... in a header file so ostream becomes std:: ostream as per...
  8. Replies
    31
    Views
    2,013

    Re: using namespace std

    compito.h should be



    #include <iostream>

    const int DIM = 3;
    struct elem{
    int info;
    elem* pun;
  9. Replies
    31
    Views
    2,013

    Re: using namespace std

    You don't say how you are learning c++. c++ is a large and complex language and until you are fairly familiar with it, when learning you just need to know that some stuff you just put in the code 'to...
Results 1 to 9 of 9


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)