Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: maluk
  • Order by date
  1. maluk

    Implementing C# properties in C++

    ...variable here is a read-only property that cannot be directly assigned to. It can only be assigned to by member functions. int main(int argc, char* argv[]) { A a; cout << a.INITIALIZED << endl; // prints 100 a.reconf(900); cout << a.INITIALIZED << endl; // prints 900...
  2. maluk

    What is meant by this?

    Haha..I guess I should just accept the fact that int() is equivalent to int (*)(). Thanks guys! Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  3. maluk

    What is meant by this?

    So int() == int (*)()? I thought the correct declaration for a pointer to a function is int (*)() rather than int(). Can anyone explain why int () is same as int (*)()? I am confused because int () for me looks like an int declaration that is very different from int(*)(). Rome did not create...
  4. maluk

    What is meant by this?

    hello? anyone? Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  5. maluk

    What is meant by this?

    ...It is in the third item of section 3. Here are the complete examples: void h(int()); void h(int (*)()); // redeclaration of h(int()) void h(int x()) { } // definition of h(int()) void h(int (*x)()) { } // ill-formed: redefinition of h(int()) Rome...
  6. maluk

    What is meant by this?

    ...What does this mean? Is that argument a pointer to function or what? If it was intended as a pointer to function then should it be declared like this: void h(int (*)()); Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  7. maluk

    A pthread_cancel problem

    It would but I am tryinh to undestand thread cancellation which is why I used pthread_cancel and pthread_testcancel. Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  8. maluk

    A pthread_cancel problem

    ...an unexpected behavior (at least I think it is). The code is show below: #include <iostream> #include <pthread.h> using namespace std; void* task(void* arg) { cout << "Starting task" << endl; for(int count = 0; count < 1000; ++count) { cout <<...
  9. maluk

    STL multimap value_type compare

    Thanks uolj! Can't I do the one you did for a multimap? Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  10. maluk

    STL multimap value_type compare

    Isn't that the predicate for the multimap is for sorting only? Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  11. maluk

    socket programming

    There is also the ADAPTIVE Communication Environment (ACE). It provides nice abstractions for your C++ needs. Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  12. maluk

    STL multimap value_type compare

    Hi all! The STL multimap accepts duplicate keys such that the following entry is valid for a multimap: KEY VALUE foo bar jack jill Now the problem is, multimap also accepts duplicate entries such that if I would add another foo, bar pair the multimap will accept it. So...
  13. maluk

    Fatal linking error in C++ on Unix

    You could always check your platform's man pages for this. You just type man gethostbyname. If the man pages are not available you can also google it and typing man gethostbyname also. Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. -...
  14. maluk

    Fatal linking error in C++ on Unix

    What platform are you compiling this from? If you are compiling under Solaris, you would need to add either of the following during linking: -lxnet -lnsl -lsocket Hope this helps! [thumbsup] Rome did not create a great empire by having meetings, they did it by killing all those who...
  15. maluk

    Why are STLs not thread-safe?

    I have read in most articles that STL is not thread-safe or should not be used in multi-threading? Why? What are other alternatives or how should one make a thread-safe STL? Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  16. maluk

    Constructors and Exceptions

    ...{ throw SomeException(); } } }; class B { public: ... private: A the_a; }; int main(int argc, char* argv[]) { B the_b; // suppose class A has thrown an exception // during class B's construction. } As you can see from the...
  17. maluk

    Getting the IP address of a network interface

    Hi! Sorry for the late reply. Here is the snippet. int ret; struct hostent *phost; struct in_addr addr; char hostname[100]; if(pIPAddrs == NULL) return -1; /* Need to find suitable return value */ ret = gethostname(hostname, 100); if(ret == 0) { phost =...
  18. maluk

    Getting the IP address of a network interface

    Help! Anyone? Rome did not create a great empire by having meetings, they did it by killing all those who opposed them. - janvier -
  19. maluk

    Getting the IP address of a network interface

    Hi! I am having a bit of a problem getting the local address of my computer. For example, my IP is something like 192.68.1.100. When a do a ifconfig -a, I can see that eth0 is assigned the said IP. So naturally, I tried getting the IP using the socket APIs. However, no matter how hard I try, I...
  20. maluk

    returned reference to a vecto and resident memory usage

    ...iter; 08 for(iter = myA.GetB().begin(); iter != 09 myA.GetB().end;) 10 { 11 if(/* condition is to delete */) 12 { 13 iter = myA.GetB().erase(iter); 14 } 15 else 16...

Part and Inventory Search

Back
Top