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

Search:

Type: Posts; User: Richard.J

Page 1 of 46 1 2 3 4

Search: Search took 0.05 seconds.

  1. Re: Returning a boost::shared_ptr from the stack without constructing it?

    Do you mean


    return boost::shared_ptr<AStarPath>(new AStarPath(from, transitions, totalCost));
  2. Re: error C2678: binary '

    std::set expects operator< to be defined for AABB. Either provide that or create the std::set<AABB, customCompare>...
    Lookup "relational operators" here:...
  3. Re: What is the common technique of using pointers to change some value on the fly?

    But most of all: you have started a question, got no replies, then edited your original post and replaced your question with a completely different one. You are here long enough to know that this is...
  4. Re: error: prototype for 'int miniBag::add(const T&)' does not match any in class

    Why are you posting the same errorneous code you've presented to us here: http://forums.codeguru.com/showthread.php?549529-I-m-having-problems-configuring-my-template-class?
    You should at least have...
  5. Re: Dequeuing Integer Values From Heap Results In Garbage Values

    This


    for (int i = h1.size() - 1; i < 0; i--)

    is wrong. Your loop is never executed because "i < 0" is false. It should read


    for (int i = h1.size() - 1; i >= 0; i--)
  6. Re: I'm having problems configuring my template class

    Inside your add method, you are trying to do


    if(!vec.has(item))

    but vec is a std::vector, which doesn't provide a has method.
    Either use


    if(!this->has(item))
  7. Re: I'm having problems configuring my template class

    Use 'template' instead of 'Template'. C/C++ is case-sensitive.
  8. Replies
    3
    Views
    449

    Re: read file content line by line

    What exception do you get?
    And why do you use 'new' for the file_mapping and mapped_region?
  9. Replies
    3
    Views
    772

    Re: identifier not found

    Thanks for correcting me, 2kaud.
    I just did a quick google without further reading when I spotted conio.h.
  10. Replies
    3
    Views
    772

    Re: identifier not found

    for clrscr/gotoxy, you need to


    #include <conio.h>

    and for this:


    file_ptr = fopen ( "C:\dict.anu", "r" );
  11. Replies
    2
    Views
    415

    Re: WSAStartup best practices?

    The online documentation of WSAStartup says
    "An application must call the WSACleanup function for every successful time the WSAStartup function is called. "...
  12. Re: How to initialize an array of DirectX9 Objects?

    I am not sure if I understand correctly.
    Say you have


    int *p = new int[3];

    This leaves you with a default initialised array which may contain any value, depending on the compiler, doesn't...
  13. Re: How to initialize an array of DirectX9 Objects?

    Is this

    not called "value initialisation" as opposed to "default initialisation" which, for POD types, does nothing at all?
  14. Re: Nonblocking connect and select() for writing

    Since the connect() call is done on the loopback address, the socket may seem to be connected immediately. I guess you would see a different behaviour using two different machines.
    I googled this:...
  15. Replies
    12
    Views
    1,303

    Re: Reduction of the flash footprint

    Disabling exception handling (if/where possible) may save you another 8-10%.
  16. Replies
    1
    Views
    488

    Re: Data exchange between Clients in UDP

    This


    if( (master_socket = socket(AF_INET , SOCK_STREAM , 0)) == 0)

    creates a TCP socket, not an UDP one. Later on, you bind that socket to an address and listen on it.
    UDP sockets work a...
  17. Re: This guy adds another new std::vector container to itself

    If position is > vector.size(), the vector will throw an out_of_range exception.
  18. Re: Sending chat messages across different computers?

    It looks like your server is only listening on "127.0.0.1". You need to listen on any available address, or at least on a network address reachable from the outside.
  19. Re: How can I create a template method in a C++ class?

    This leaves you with a memory leak. The new Worker object is a temporary object you can never delete. Since you are not using it anyway, your method could be defined like this


    template<class T> ...
  20. Re: How can I create a template method in a C++ class?

    Apart from what OReubens suggested, I recommend not to return a raw pointer to the object, but a smart pointer. This relieves the caller of createObject from the question of the ownership of the...
  21. Replies
    4
    Views
    792

    Re: how to export class with template

    Is UTILITIES_EXPORT in your program defined correctly?
  22. Re: Backspaces in printf - formatting question

    IIRC, something like


    printf("%*s", countBackspaces, tmpString );

    but shouldn't this be "spaces" or "blanks" instead of backspaces?
  23. Re: Why Netbeans make use of Posix path style?

    While your PATH point to D:\mingw32\bin, your shell complains about "/D/mingw64/bin/make.exe", so maybe there is a colon missing after the "D"?
  24. Replies
    6
    Views
    736

    Re: Beginner- simple question

    In VS2010, it's "Debug - Start without Debugging" or Ctrl + F5.
    In other versions, it might be similar.
  25. Replies
    3
    Views
    1,324

    Re: A Server Side program in network

    A scalable server, this looks like a task for IO Completion Port. My first thought was about ::select(), but that cannot handle a large number of sockets, IIUC.
Results 1 to 25 of 1128
Page 1 of 46 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center