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

Search:

Type: Posts; User: Paul McKenzie

Page 1 of 80 1 2 3 4

Search: Search took 0.37 seconds; generated 31 minute(s) ago.

  1. Replies
    8
    Views
    286

    Re: Adding element into an n-ary Tree

    Why don't you use std::list instead of your home-made List class?

    Regards,

    Paul McKenzie
  2. Re: run-time check failure #0 - the value of ESP error with conversions

    1) Your read loop does not check if it goes over 500 entries.

    2) Why are you writing your own sort function, when you could use just std::sort?
    There is a big difference between "compiling fine"...
  3. Replies
    27
    Views
    956

    Re: why is this code crashing?

    One way to learn is to take the code I posted, compile it, and step through it with a debugger. You will see it gives you the correct results, all without loops. It almost uses no logic, except...
  4. Replies
    27
    Views
    956

    Re: why is this code crashing?

    Just for the heck of it, I coded this up. I won't go into how it works, since this is supposed to be homework.

    However, I posted it to illustrate what can be accomplished using the various...
  5. Replies
    27
    Views
    956

    Re: why is this code crashing?

    For example, here is a breakdown of cont1 and cont2, according to your description:


    cont1 = {4,34} {76,4} {3,5} {6,7} {67,19} {37,59} {38,33} {98,31} {12,19} {87,45}
    cont2 = {32} {98} {3} {55}...
  6. Replies
    27
    Views
    956

    Re: why is this code crashing?

    So take that data you posted -- what should the output be? Even better, show us with a smaller sample.

    Regards,

    Paul McKenzie
  7. Replies
    27
    Views
    956

    Re: why is this code crashing?

    You need to clarify what is meant by "repeating". You have a pair of numbers -- by "repeating" are you talking about the two numbers in the pair? Or pairs that have the same data? See the...
  8. Replies
    27
    Views
    956

    Re: why is this code crashing?

    for (chk2 = cont3.begin(); chk2 != cont3.end(); chk2++)
    That one line of code shows that chk2 does refer to the cont3 vector. It is an iterator into that vector. The replacing function messes up...
  9. Replies
    27
    Views
    956

    Re: why is this code crashing?

    Another thing you should do -- start out with 5 or 10 numbers, not 50. That way, bugs can be easily worked out with a smaller set of input values.

    Regards,

    Paul McKenzie
  10. Replies
    27
    Views
    956

    Re: why is this code crashing?

    One thing I see that is clearly wrong is that you're changing a vector while you're using iterators from that vector to loop.

    for (chk2 = cont3.begin() ; chk2 != cont3.end(); chk2 ++)
    ...
  11. Replies
    27
    Views
    956

    Re: why is this code crashing?

    Run the program under the debugger -- that is what anyone here would do to solve the problem, so you must learn how to do this. Now would be a good time to learn.

    Also, just because a program...
  12. Re: How to handle the exceptions that couldn't be caught by try/catch?

    Division by 0 is not a standard C++ exception, so there is nothing to "catch" since nothing is thrown.

    Regards,

    Paul McKenzie
  13. Replies
    5
    Views
    462

    Re: dynamic array resizing

    Honestly, your assignment doesn't make sense, even if you can't use vector.

    You're creating a dynamic array in main, but then you just call resize() which basically boils down to doing nothing. ...
  14. Re: What could cause a core dump at iterator pre increment??

    Unless it is a container such as std::map, you should strive to not erase elements in a container while you're looping over the same container. I have seen too many code examples where the coder is...
  15. Replies
    18
    Views
    2,113

    Re: How to use set?

    It does not free the memory that you allocated.

    Ask yourself this -- how would a std::set<char*> know that the pointer that is there points to dynamically allocated memory? It doesn't know.
    ...
  16. Re: pointer-to-member array crashes with virtual inheritance

    From 4.11.2 of the ANSI standard:


    Regards,

    Paul McKenzie
  17. Re: pointer-to-member array crashes with virtual inheritance

    Doesn't compile here:

    http://ideone.com/TbDZg2

    Regards,

    Paul McKenzie
  18. Replies
    7
    Views
    1,002

    Re: Math Doesn't Match

    Please post the output you're getting now, plus the input you're using.

    Second, just to warn you -- floating point calculations when done on a binary-based system such as a computer will not be...
  19. Replies
    3
    Views
    368

    Re: How to debug Win32 Message Loop?

    I highly recommend you use a dual monitor for debugging GUI issues, where Visual Studio is on one monitor, and your application is on the other monitor. Or get a very large monitor and...
  20. Re: STL functions shows a segmentation fault.

    If a static library is built with _SECURE_SCL=0, the all libraries that link to it that use STL must be built with the same setting.

    As to your code "working" on OS and not another machine --...
  21. Re: A question regarding throwing an exception

    It isn't just a "good practice". You cannot allow exceptions to leave a destructor, period. Therefore you have no choice but to catch anything before the destructor completes.
  22. Re: Can two functions in same DLL be called by two threads?

    How are you suspending the thread? If you're using SuspendThread, that shouldn't be used for synchronization.

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms686345%28v=vs.85%29.aspx
    ...
  23. Re: Developing Unmanaged aplications in VS2013 to Work Just Like VC6 Did

    Choose the "Multi-Thread" version of the runtime library in the Project Settings instead of the "Multi-threaded DLL" version. (Properties -> C/C++ -> Code Generation -> Runtime Library).

    Also,...
  24. Re: string::pop_back: Build error in DevC++

    DevC++ is not a compiler, it is an IDE. The compiler that comes with DevC++ is an old version of g++ that does not support string::pop_back. So the solution is to get a more modern compiler (g++...
  25. Replies
    5
    Views
    2,372

    Re: Why I cannot open tiff file?

    Press Retry, look at the call stack, and inspect which functions were called that led up to the error. Since libTiff has full source code, you can easily see what is being done and the cause for the...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center