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

Search:

Type: Posts; User: Luis G

Page 1 of 2 1 2

Search: Search took 0.06 seconds.

  1. Replies
    12
    Views
    1,866

    Re: console input/ouput at the same time

    Why not print in one portion of the screen and input in another?
    Look for conio.h or ncurses.h, dunno if there's a C++ equivalent.
  2. Re: new way of overloading operators in templates??

    I found out. The correct code is:



    #ifdef _MSC_VER
    friend CMatriz<TG> operator+(const TG &op1,const CMatriz<TG> &op2); // objeto TG + CMatriz
    friend CMatriz<TG> operator+(const double...
  3. Re: new way of overloading operators in templates??

    Many thanks for the help, I've done what you said but it still gives the same errors.

    This is how it looks now:


    template<class TG> class CMatriz;
    template<class TG> ostream& operator<<...
  4. Re: new way of overloading operators in templates??

    For the record, I solved the ostream << problem by adding:


    template<class TG> class CMatriz;
    template<class TG> ostream& operator<< (ostream & os, const CMatriz<TG> &op);


    Before declaring...
  5. new way of overloading operators in templates??

    First of all, this code does compile with g++ 3.3.5. But with g++ 4.0.2 it gives me a few errors. g++ enters the #else portion. The _MSC_VER is meant to be able to compile it in VC++ 5



    #ifdef...
  6. Replies
    2
    Views
    1,754

    Re: (pure C) file compression code

    This guy presents a technical report and gives C++ code for a file compressor using arithmetic coding and an adaptive order-0 model
    http://www.bodden.de/studies/ac/

    I know you're searching for C...
  7. template help, operators overload and type of

    So basically I want to do the following operations:

    CMatriz<sometype> matrix1;
    sometype tg1;

    matrix1+tg1;
    matrix1+5.0;

    However:
  8. Re: returning objects, not all members are copied?

    Too bad there's no way (or easy way) to keep the natural syntax I want and make it efficient.

    I was thinking I should implement those operators just as you suggested.

    Thanks again for the...
  9. Re: returning objects, not all members are copied?

    Thanks for the quick reply.
    I'm researching as to how to do a copy constructor, it's been a while since I did some basic programming in C++ and I don't remember ever coming into that.

    To make it...
  10. returning objects, not all members are copied?

    The template declaration:

    template<class TG> class CMatriz
    {
    public:
    CMatriz(unsigned int j,unsigned int k=1);
    ~CMatriz();
    CMatriz<TG> T(void);
    void inserta(unsigned int j,unsigned int...
  11. Replies
    11
    Views
    1,080

    I've heard of an undelete tool for Linux, try...

    I've heard of an undelete tool for Linux, try searching freshmeat.net
  12. Research about semaphores. I've used them with...

    Research about semaphores.

    I've used them with parent and child process, not sure about their behaviour with threads.

    semget(), semctl() and semfree() (not sure about the last one)
  13. Replies
    4
    Views
    829

    Ohh i found the error, i should not use...

    Ohh i found the error, i should not use "Connect()" method, i guess it should just be used for SOCK_STREAM.

    I'm using CAsyncSocket btw :D

    A bit of background of the program i'm doing:

    My ISP...
  14. Replies
    4
    Views
    829

    I was about to post the same question. I've...

    I was about to post the same question.

    I've done Create and Connect on both ends, but SendTo and ReceiveFrom, seem to not work.

    Well, i'm doing the ReceiveFrom in the OnReceive() function, if i...
  15. Replies
    1
    Views
    586

    If the other peer is receiving the packets, then...

    If the other peer is receiving the packets, then we have two possibilities:

    - The other peer is not sending a response, firewalls tend to ignore incoming ICMP packets.

    - You are not receiving...
  16. Replies
    15
    Views
    9,160

    Homework, huh? :D Visual C++ as well as many...

    Homework, huh? :D

    Visual C++ as well as many other compilers have debugging tools, why don't you insert breakpoints or run it step by step so you can find what the problem is?

    If you did a good...
  17. ok, i might not tell the right answer, but just a...

    ok, i might not tell the right answer, but just a small thought i had when i saw the coordinates.

    why don't you change them to
    (-1,0,1)-front left
    (1,0,1)-front right
    (-1,0,-1)-rear left...
  18. ow, i was thinking something like "receive from",...

    ow, i was thinking something like "receive from", or force the assigning of a "well known" port to the connections.
  19. establish socket connection without a listen port

    Is there a way to make a socket connection (TCP) between to peers without using a listen port?

    Right now i'm using CAsyncSocket, but i could change that.

    Thanks in advance.
  20. that code should work. Just for the sake of...

    that code should work.

    Just for the sake of it, try this piece of C code



    #include <stdio.h>


    int main()
  21. Replies
    31
    Views
    4,347

    I should have been more clear, 'cause "that looks...

    I should have been more clear, 'cause "that looks like C to me" is a little vague, I should have said, that is C code.

    You'd be surprised by the ammount of books and teachers that confuse C with...
  22. Replies
    31
    Views
    4,347

    i'm definitively not a big fan of C++, but i can...

    i'm definitively not a big fan of C++, but i can tell you that you're not programming in C++, that looks like C to me.
  23. Eli Gassert, those are not raw sockets. Proof: ...

    Eli Gassert, those are not raw sockets. Proof:
    sListen = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);

    SOCK_STREAM is TCP.

    As far as i know there was no way to programm true raw sockets in...
  24. Thread: Socket

    by Luis G
    Replies
    3
    Views
    645

    You could try to open each port, on ports already...

    You could try to open each port, on ports already in use the listen function should return an error code.

    Other way would be to manually attempt connections to 127.0.0.1 (localhost) at port X, if...
  25. Replies
    2
    Views
    857

    Thanks a lot, right now i'm reading other...

    Thanks a lot, right now i'm reading other questions of that FAQ, a couple of tests using that approach reduced the cpu utilization to 15% (instead of 100%), and most of that 15% is used by prog2.
    ...
Results 1 to 25 of 40
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured