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

Search:

Type: Posts; User: D_Drmmr

Page 1 of 5 1 2 3 4

Search: Search took 0.07 seconds.

  1. Replies
    4
    Views
    162

    Re: depth-first search of a graph

    It's actually not correct to call this a matrix, because it may not have the same number of columns in each row. The correct term would be jagged array. This also means that you cannot create it as a...
  2. Replies
    20
    Views
    428

    Re: A Predator-Prey Simulation

    Did you not get any comments/feedback from your teacher? If not, then check your results with another student or with another implementation, e.g. in a spreadsheet. Find out where any difference...
  3. Replies
    4
    Views
    162

    Re: depth-first search of a graph

    Sounds to me like your matrix is your data structure.
  4. Replies
    8
    Views
    230

    Re: Advice on structured header use

    C++ is not just object oriented; it's multi-paradigm. Procedural and generic programming is also fully supported by C++. There are many C++ libraries that are header-only, notably the Boost...
  5. Replies
    8
    Views
    230

    Re: Advice on structured header use

    Most of these are good guidelines. The second (header guards) could be replaced by using "#pragma once" if it is supported on all target compilers. This avoids the hassle of having to come up with...
  6. Replies
    4
    Views
    148

    Re: Ignore negative number

    The code snippet you posted does not "take a number". You'll have to show the code you are talking about, otherwise we can only guess.
  7. Replies
    22
    Views
    299

    Re: PLEASE with this code!!!!!

    Why did you use HTML tags again? Did you not read VictorN's post?

    Which line is giving you a compiler error and what is the error?

    The link in my previous post gives a full explanation of how...
  8. Replies
    22
    Views
    299

    Re: PLEASE with this code!!!!!

    The code looks quite good (I didn't look in detail), but there are a couple of issues.
    You do not check if the user input is valid, i.e. you check the value, but not the type. See Why does my...
  9. Thread: Prime Numbers

    by D_Drmmr
    Replies
    28
    Views
    461

    Re: Prime Numbers

    Please show us your code.
    Did you run a fully optimized build of your program?
  10. Replies
    7
    Views
    220

    Re: Memory Leak in Constructor?

    Memory leaks don't cause heap corruption. At worst, they can make your program run out of memory. That's not to say you shouldn't fix them, of course.
  11. Replies
    42
    Views
    1,318

    Re: When to use pointers?

    Seems to me that you want to communicate too much with a pointer. It should communicate ownership and 'out' parameters, but it is also the only (descent) way to have optional function parameters....
  12. Replies
    16
    Views
    359

    Re: Calculation Problems

    It's good design to separate user interface from business logic in your application. Displaying (intermediate) results is user interface; calculating them is business logic, in this case.
    For the...
  13. Re: How to arrange work Between WndProc & New Thread

    I don't understand. GDI does not paint anything unless you tell it to.
    Please show your code to handle WM_PAINT for the parent and child window.
  14. Re: How to arrange work Between WndProc & New Thread

    Instead of trying to prevent the message loop from sending messages to your window, you should just repaint it when it gets the WM_PAINT message.
  15. Replies
    7
    Views
    246

    Re: Need help with error C2664

    I wouldn't say they are almost the same, because they are not convertible to each other.


    void foo(char** test);
    void bar()
    {
    char array[] = "test";
    foo(&array); // error C2664: 'foo' :...
  16. Replies
    5
    Views
    216

    Re: Get maximum memory usage of My App

    Task manager can also show peak memory usage.
  17. Replies
    4
    Views
    248

    Re: Undefined reference to

    Did you include Atom.cpp in your project/makefile?
  18. Replies
    5
    Views
    306

    Re: How does const_cast work?

    Your program is ill-formed. According to the standard, you are not allowed to assign to the result of a const_cast when the original is defined as const. "Casting away const" just means that you are...
  19. Re: Can't intialize C++ Struct with CString in it??

    Why are you asking someone else these questions if you didn't answer them yourself?
    Really, it's not that hard to understand that you can do better than "it doesn't work". The only sensible response...
  20. Replies
    2
    Views
    226

    Re: Any help is appreciated.

    Are you sure it reads the second line? Maybe you should look closer. ;)

    Did you write down the steps that the program should take before writing any code? If so, did you step through your program...
  21. Re: Can't intialize C++ Struct with CString in it??

    The struct keyword is not necessary in C++ to define a variable of type 'print'.
    What you are trying to do here is to convert a const char[] to a CString*. That's not possible, because these are...
  22. Replies
    8
    Views
    270

    Re: Constructors in a singleton

    If you want to avoid the default generated copy constructor (or copy assignment operator), all you need to do is declare it private and do not define it. This way you will get either an access...
  23. Replies
    8
    Views
    270

    Re: Constructors in a singleton

    Why do you want to have a const and a non-const overload of your copy constructor? I'm not even sure that will compile, but I certainly can't see how it could be useful.
    For that matter, why do you...
  24. Replies
    42
    Views
    1,318

    Re: When to use pointers?

    Yes, when you have a factory it is good practice to return a smart pointer (either shared_ptr if you need reference counting or (normally) a unique_ptr).

    I think it's good to make a clear(er)...
  25. Replies
    42
    Views
    1,318

    Re: When to use pointers?

    The major difference between a reference and a pointer is that a pointer can point to NULL and you can change what a pointer points to. Neither is possible with a reference.
Results 1 to 25 of 120
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width