Search:

Type: Posts; User: DirkMaas

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    1,020

    I would venture to guess that your explicit call...

    I would venture to guess that your explicit call to the destructor causes the destructor to be executed, setting m_Val to 5, but the destruction has little effect until something else overwrites the...
  2. Replies
    11
    Views
    2,388

    The functions that return Number instead of...

    The functions that return Number instead of Number& are returning temporary objects, and the compiler always makes temporary objects const. These const objects can't be used as non-const arguments. ...
  3. Replies
    3
    Views
    2,309

    Yes, it is valid, though you lose the address of...

    Yes, it is valid, though you lose the address of "some string" for good when you re-assign pszString to something else. Both strings are stored in the static data area, and so go out of scope, and...
  4. Thread: header file

    by DirkMaas
    Replies
    9
    Views
    1,089

    Sorry, that was a using directive in your header...

    Sorry, that was a using directive in your header file, not a using declaration.

    The reason it's not a good idea to put a using directive in a header file is that it opens the namespace in every...
  5. Thread: header file

    by DirkMaas
    Replies
    9
    Views
    1,089

    Assuming that you want to declare findEdge() and...

    Assuming that you want to declare findEdge() and the others as const member functions, the proper syntax is
    EdgeNode* findEdge(const int &source,const int &dest) const;The compiler is complaining...
  6. For rounding, do an internet search for "C++...

    For rounding, do an internet search for "C++ round number." You'll get a bunch of hits. There's some code here: CIS Department > Tutorials > Software Design Using C++ > Arithmetic and Formatting of...
  7. Basic question, but are you sure your DATA ...

    Basic question, but are you sure your DATA folder is named InputFiles? Your post indicates that you're stopping in getDir(). With errno=2, strerror(errno) gives "No such file or directory." Using...
  8. In cases like this, it's a good idea to try to...

    In cases like this, it's a good idea to try to isolate the problem. Comment out everything that's not related to opening the file. Hardcode the file name in the call to open().

    I played around...
  9. Replies
    2
    Views
    1,606

    There are good resources on this site and on the...

    There are good resources on this site and on the web, but you need to dig. Try C and C++ Compiler Information and Reviews - Cprogramming.com for starters.
  10. Replies
    3
    Views
    1,309

    If someone explains it to you, you'll be deprived...

    If someone explains it to you, you'll be deprived of the satisfying experience of figuring it out for yourself. Do you have a debugger? If so, run it on these programs, examining variables as you...
  11. Replies
    3
    Views
    1,175

    Inherited classes contain the members of their...

    Inherited classes contain the members of their base classes (the classes they inherit from). Because Car inherits from Vehicle (as you have defined them), when you create a Car, it will have the...
  12. Replies
    11
    Views
    1,892

    Since the constructor calls in the initializer...

    Since the constructor calls in the initializer list are made before the statements in the body of the constructor are executed, the list makes it possible have a fully created and initialized object...
  13. Thread: sqrt function

    by DirkMaas
    Replies
    16
    Views
    14,610

    You're not calling mySquareRoot() correctly in...

    You're not calling mySquareRoot() correctly in the do loop. In that loop, replace mySquareRoot with mySquareRoot(num).

    The way your loop is structured right now, you'll try to find the square...
  14. Replies
    11
    Views
    1,892

    That is a constructor for struct node. The...

    That is a constructor for struct node. The braces
    {} indicate that it is in inline form. The colon and the statements before the braces are the initializer list. For more info on initializer...
Results 1 to 14 of 14