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

Search:

Type: Posts; User: cosminflorea

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    12
    Views
    12,399

    Re: printf(0 + 'move up one line'

    Can you explain, please, how did fflush(stdout) solve your problem ?
  2. Replies
    1
    Views
    2,679

    Re: static library dependency

    You only have to try to link if the target is an executable file. If the target is a library, then try to build the final executable too.
  3. Replies
    6
    Views
    541

    Re: Member function problem

    It is not, the code i posted is only a proof of concept.
  4. Replies
    6
    Views
    541

    Re: Member function problem

    You can do like this:


    class ServiceImplClass
    {
    class SimpleThread
    {
    SimpleThread(ServiceImplClass* pParent); // keeps a reference to the parent; used to access...
  5. Replies
    2
    Views
    1,062

    Re: How to debug lost packet

    - use netstat on the server host to see if the server is up;
    - use telnet <IP> <port> from the real client machine (or a different computer in your network) to see if the server is reachable from...
  6. Replies
    5
    Views
    1,191

    Re: Doubt with sockets...

    The nonblocking mode is not important in this case. You must always loop until you receive all the bytes you wanted to, like this:



    int n=0;
    do
    {
    n += recv(socket, buffer, 1024, 0); // also...
  7. Replies
    1
    Views
    2,039

    Re: Socket connection and select

    This is the signature of the select function:


    int select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *timeout);


    Based on this, you are using this function...
  8. Re: Reading from File into Class - Compiler Error

    You have this:

    istream & operator >> (istream & s, Candidate & v)
    and you wanted to use this:

    istream & operator >> (istream & s, Candidate* v)
  9. Replies
    10
    Views
    2,800

    Re: template external linkage

    From your code I understand that you wanted to instantiate Singleton<T> for T=SlaveManager. The 2 errors tells that, at the point of the instantiation, the linker is unable to find the definitions...
  10. Replies
    4
    Views
    763

    Re: undefined reference error?

    Did you solve your problem? If not, this may help

    - try this command: "nm libbase.a | grep Malloc2D_uchr" to see if the library does contain your function
    - in file bmalloc.h wrap your...
  11. Replies
    9
    Views
    1,882

    Re: MFC & Internet

    Are you sure the server is running? You can use telnet to test if the server is listening.
  12. Replies
    4
    Views
    1,092

    Re: template specialization question

    You can try this:



    template<typename T>
    T addone(T x)
    {
    return x+1;
    }
  13. Re: How to send packet to myself when I'm disconnected

    I have no experience with mobile devices, but for a PC:
    1) sendto() is to be used with UDP sockets, not TCP.
    2) if you have a TCP socket which is not connected anymore, you can reconnect it to...
  14. Replies
    14
    Views
    2,133

    Re: C++ Stream Issues

    Your operator is incorrect because it is recursive (it calls itself) and doesn't have a stop condition. If you run thatcode, you'll get and endless loop.
  15. Replies
    4
    Views
    1,745

    Re: static block simulation / emulation

    There are not "static blocks" in C++; if you want to have static initializers per class in C++, you must take care to call them explicitly before making any object of that class. Also, in C++, global...
  16. Re: GetMessage not responding when I am in another window

    I think that you should check always if there are changes to your file. If your window is not active, it doesn't receive messages and your test doesn't take place. You may try this



    while...
  17. Replies
    5
    Views
    4,039

    Re: C++ double literal problem

    I need to be able to create such BigDecimal instances out of double literals (like Java does).
    But i think you are right, maybe the response to my question is the "precision", if the number of...
  18. Replies
    5
    Views
    4,039

    Re: C++ double literal problem

    Java doesn't seem to have the same issue; that is why i think there is a way to "guess" the "exact" value in this case.
  19. Replies
    5
    Views
    4,039

    C++ double literal problem

    Hello,

    I have the following problem in C++. I wrote a C++ implementation of the java class BigDecimal, but i have a problem with the double literals. So, i have this code fragment:

    ...
  20. Re: looks like exec. say's its exec. but is it?

    Try this comamnd: file <your_file_name>
  21. Replies
    11
    Views
    1,164

    Re: constant perplexity

    It is returning a non-const object because this is its purpose, to remove the const.
    In C++ you cannot call a non-const method for a const object. If you have a non-const method that doesn't affect...
  22. Replies
    11
    Views
    1,164

    Re: constant perplexity

    Once you declare a const variable, the compiler is free to place it into an "read only" code segment; if this happens, it is not possible to change this variable anymore. If you still want to access...
  23. Replies
    7
    Views
    826

    Re: Size of the Derived class

    You can define an "operator new" in your Base class; the compiler calls this operator with the right size of the memory to be allocated. But you must find a solution for stack allocated objects...
  24. Replies
    2
    Views
    955

    Re: hash_set problem

    Try this:



    namespace __gnu_cxx
    {
    template<>
    struct hash<MyClass*>
    {
    bool operator()(const MyClass* s1) const
  25. Re: Compilation issues generating SEGMETATION FAULT

    The initialization order for static variables defined in different translation units is undefined in C++ - this could be a reason; check the dependences between your static members/global variables.
Results 1 to 25 of 38
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured