Pages

Sunday, July 4, 2010

Tips for socket programming lab2

1. Important point you can only type cast a pointer into another, it implies that you can not type cast an integer to the type void * etc.
2. The last argument of the thread function takes a void pointer as its argument so firstly keep point 1 in mind and secondly either you can declare a pointer or the better option might be to simply pass the variable by reference.
3. If you passed a variable by reference don't forget to dereference it. syntax * referenced_variable
4. When you compile the code, keep in mind that now you need to tell the compiler that it needs to use the lpthread library at link time. So don't forget to make relevant changes to your make file.
5. Enjoy your programming, its never too late to learn :)

1 comment:

  1. thankyou sir this is what most of us were looking for..

    ReplyDelete