Search:

Type: Posts; User: anykey

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    9,798

    Daved is right. If you're working with a lot of...

    Daved is right. If you're working with a lot of arrays or vectors and you go past the array bounds segfaults usually come well after the actual error. I was recently doing something like that myself...
  2. Replies
    2
    Views
    2,044

    orbitz, thanks. valgrind looks useful. I need it...

    orbitz, thanks. valgrind looks useful.
    I need it as cure rather than prevention, debugger sometimes doesn't tell you enough about the real location of error, especially in case of stack corruption.
  3. Replies
    2
    Views
    2,044

    array bounds checking

    Are there any utilities for Linux/Widows which check for array bound violations and possibly stack corruption in C++ programs?
    Something like an emulation of runtime provided in other languages?...
  4. Replies
    2
    Views
    1,549

    Daved, thanks for the quick reply. I'm...

    Daved, thanks for the quick reply.
    I'm unfortunately not very familiar with boost, but I like the idea with a list and a set. I think I could do something like this.
    As far as history is concerned...
  5. Replies
    2
    Views
    1,549

    best way to search through 'history'

    Here is a summary of my question:
    I have a particular class


    class Combination;

    there is a function which generates objects of this class:


    Combination makeCombination();
  6. Replies
    7
    Views
    1,361

    Brian, thanks!

    Brian, thanks!
  7. Replies
    7
    Views
    1,361

    which is faster?

    Suppose I have some kind of structure:


    typedef struct MyStruct {
    int a;
    }

    will there be any difference in the execution time of this code:
  8. Replies
    5
    Views
    3,971

    Oh yes, I missed that. Great minds think alike,...

    Oh yes, I missed that.
    Great minds think alike, huh? :D :D
  9. Replies
    5
    Views
    3,971

    Or you could have a member function reset() in...

    Or you could have a member function reset() in your CMyClass which resets the class as you want.
  10. Thread: attempt 2

    by anykey
    Replies
    3
    Views
    1,109

    Yes this code is hard to read. First thing that...

    Yes this code is hard to read.
    First thing that really sticks out here is that the do-while loop uses (0<1) as a condition which is always true. Since you don't have any break exit or return...
  11. laserlight, why do you have this line of code in...

    laserlight, why do you have this line of code in your enlarge() function:


    temp = 0;
    ?
    memory allocated to temp has already been delete[]d and temp itself will go out of scope the next line of...
  12. Replies
    6
    Views
    1,376

    You could use std::multimap.

    You could use std::multimap<char, COORD>.
  13. Well psasidicrum in my (rather limited)...

    Well psasidicrum in my (rather limited) experience it is hard to understand code without any kind of documentation unless its not very complex. If you download source code with hundreds of header and...
  14. Replies
    3
    Views
    1,501

    thanks, should have thought of that myself :o

    thanks, should have thought of that myself :o
  15. Replies
    3
    Views
    1,501

    size of a pointer

    purely out of curiosity, does anyone know the size of a pointer in memory (under Windows OS)?
  16. Replies
    17
    Views
    3,847

    hk_mp5kpdw (hope i got this right :) ) thanks a...

    hk_mp5kpdw (hope i got this right :) ) thanks a lot, that solves my problem.
    'name' is an int, so should work fine.
    Once again, thank you.
  17. Replies
    17
    Views
    3,847

    problem with a map iterator

    Hi,
    I have a map of an object of a certain class and a vector of another class. I have an iterator for this map which I need to 'jump' several positions forward. Here is the relevant code:

    ...
  18. Replies
    7
    Views
    37,411

    Off the top of my head, here is a possible...

    Off the top of my head, here is a possible recursive algorithm for doing this. However, it is very inefficient and i think it stores differrent permutations of a same subset (e.g. it'll see {1, 2, 3}...
  19. Replies
    11
    Views
    4,218

    I guess that whenever you have a for loop you...

    I guess that whenever you have a for loop you could do the same thing with a while loop and vice versa. But for a beginner, using a for loop when you have a predeterminate number of steps to perform...
  20. Replies
    12
    Views
    1,880

    It could be because of that, yes, since...

    It could be because of that, yes, since insertNode asks for a String* and you give it a char*. However, I haven't really worked with System::String before so I can't really say.
    Also, this line of...
  21. Replies
    12
    Views
    1,880

    I might be stating the obvious but if you say the...

    I might be stating the obvious but if you say the program crashes after you try to insert the first node into the BST, at this point the tree must be empty. So the problem must be in this code:

    ...
  22. Replies
    9
    Views
    1,772

    maro, do you have to use char* to store the name?...

    maro, do you have to use char* to store the name? If not, it would be a lot easier to use std::string instead.
    Also, if you have to use an array, there is no need to delete the array, just...
Results 1 to 22 of 22