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 SkipVought 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++

    Here's a way you could implement C#'s property concept: We want the public member variable INITIALIZED to be read-only. Here's how to implement it. class A { public: A() : INITIALIZED(initialized_) { initialized_ = 100; } void reconf(int i) {...
  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?

    Nope. This one I found on the C++ Standards (ANSI ISO/IEC 14882) document. Here's the link here: http://www.kuzbass.ru:8086/docs/isocpp/over.html It is in the third item of section 3. Here are the complete examples: void h(int()); void h(int (*)()); // redeclaration of...
  6. maluk

    What is meant by this?

    I found a declaration like this: void h(int()); 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...
  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

    Hello all! I am experimenting with pthreads. Now I have encountered 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 =...
  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

    Hi guys! What is the corrext way to handle exceptions during construction of a member object? A code snippet is give below: class SomeException {}; class A { public: A() throw(SomeException) { if(...) { throw SomeException(); }...
  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

    I have code that returns a reference to a member variable. The member variable is a vector of a certin class. This class consumes 5848 or more bytes. The process is like this, I loop on the number of objects in the vector described above using iterators in a for() loop. So I have a class like...

Part and Inventory Search

Back
Top