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

Search:

Type: Posts; User: monarch_dodra

Page 1 of 80 1 2 3 4

Search: Search took 0.07 seconds.

  1. Re: Need help allocatig memory for vectorized 2D array

    Yeah, the take home point here is that "[][]" is a bad idea. "(x, y)" (or "get(x ,y)" if you don't like operator()) is the way to go.

    An argument in favour of "[]" is that it could return an...
  2. Replies
    4
    Views
    269

    Re: Error 127 - Process not found

    If your error is "Error 127 - Process not found", the it is not a C++ problem, but an environment/program problem. There is absolutely nothing wrong with your program, which should work as-is....
  3. Replies
    6
    Views
    288

    Re: Variable declaration syntax?

    Actually, we should now prefer uniform initialization, and possibly, the "almost always auto" anitialization.
  4. Re: Handing more than one exception at a time

    Yes, it did not disprove the UB. It did disprove the "If you do it anyways, it terminates". Which was kind of my point that both statements are contradictory (you can't have UB if the standard...
  5. Re: Handing more than one exception at a time

    Wait what? since when? That's news to me. Are you sure about this? AFAIK, you just *shouldn't* throw exceptions in destructors. Do you have any references for that?

    If you do it anyway, and it...
  6. Re: cast Base class pointer to derived class pointer: when will this fail

    Agreed. But when all that is said and done, dynamic_cast is usually frowned upon and a good sign of code smell. As for private inheritance, while I understand the concept and use-case, I have NEVER...
  7. Re: cast Base class pointer to derived class pointer: when will this fail

    It doesn't really "work". It just appears to work. The cast is illegal, and you are in undefined behavior.

    The reason you *think* it works is because dif was *not* declared virtual, and as such...
  8. Replies
    6
    Views
    392

    Re: template operation issue

    I'm not sure what you mean by "recursively incomplete". The issue is rather that you will have multiple definition issues (since you are redefining it on a "per template instance" basis). As (kinda)...
  9. Replies
    19
    Views
    746

    Re: Why not C?

    This thread is so ridiculously off topic (and against TOS), that I don't know why any of us are still replying. Not only that, the actual question itself is vague beyond the possibility of any...
  10. Replies
    2
    Views
    245

    Re: RFC 2046: Mime types

    My first google result for "mime case sensitive" (http://stackoverflow.com/questions/12869278/are-mimetypes-lowercase-case-insensitive) seems to indicate that RFC 2045 states that (quoting quote from...
  11. Re: overriding base class template method

    Be careful. This is probably not what you wanted. I believe what you wanted here was to do a "specialization"? This is not what you did. What you did was declare a template parameterized on *a*...
  12. Replies
    18
    Views
    842

    Re: [RESOLVED] map iterators

    Actually, that's a good point. I forgot about that. That means that my_map.end() is always valid *for a given map*, regardless of what you do to that map.

    I would also guess that that kind of also...
  13. Replies
    18
    Views
    842

    Re: [RESOLVED] map iterators

    Sounds like a good plan actually :)
  14. Replies
    18
    Views
    842

    Re: [RESOLVED] map iterators

    Hum... I'd have suggested "optns.end()" instead... ?

    Although if you do modify optns, then later, your piter might not compare with .end()

    I'd have suggested simply "OPTITER()", but depending...
  15. Replies
    51
    Views
    2,364

    Re: .h and .cpp

    I'm pretty sure there is also a big implication on compilation times...
  16. Re: suggestions for changing some bit of a number

    Generate 3 random numbers between 0 and 191, and flip those bits?

    Just make sure you don't generate the same number twice: Either re-roll when it happens, or try a random shuffle.
  17. Re: Creating a good computer AI for a tic tac toe game.

    To add to that, I'd add an abstract class called "Player", which would have different implementations, such as "HumanPlayer" "DumbAI" "SmartAI" etc...

    A Game would be made of 2 Players and a...
  18. Replies
    8
    Views
    565

    Re: Adding element into an n-ary Tree

    My first comment is: "I know it's easier using std::list but we were asked to implement the projet using our own home-made List class, so we learn how to do it." I don't see a home made list class...
  19. Replies
    8
    Views
    565

    Re: Adding element into an n-ary Tree

    Should your nodes hold the number information in some place? Or is the idea that the node's index in its container makes that implicit?

    In any case, to insert a word, I'd decompose it into its...
  20. Replies
    10
    Views
    595

    Re: Hepl me with search name code in C++

    Ideally, I think you should store your names in an (unordered_)set. A set is a data structure that manages its own ordering, and is itself capable of retrieving items for you, and knowing if they are...
  21. Replies
    10
    Views
    595

    Re: Hepl me with search name code in C++

    You need to read what you just wrote. Which variable are you using to iterate?
  22. Replies
    10
    Views
    595

    Re: Hepl me with search name code in C++

    Please properly format your code. I don't see any "search name" function. What exactly isn't working for you?



    This declares a variable length array and is not standard C++. Use an std::vector...
  23. Replies
    6
    Views
    521

    Re: c++ memory allocation question?

    I remember this question with the actual "design requirements" which would have better helped answer. As is, we can only guess from the names what the functions should do. My guess is:



    Yes.
  24. Replies
    4
    Views
    410

    Re: find object in vector and delete

    There is a version of find called "find_if" that can take a predicate, and will return an iterator to the first element for which pred(e) returns true.

    If you do a functor approach (with state!),...
  25. Re: Help with c++ date validation program

    BTW, month names in English are capitalized.
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