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

Search:

Type: Posts; User: code_carnage

Page 1 of 11 1 2 3 4

Search: Search took 0.04 seconds.

  1. Re: Implementing single threaded asynchronous TCP server

    I am getting the feeling that, one thread is spawn internally for accepting connections and main thread is for processing those connections, that makes it total two threads, correct me if I am...
  2. Implementing single threaded asynchronous TCP server

    Hello Guys,
    I need help in implementing asynchronous single threaded TCP server using boost asio.. Any example or link will be highly appreciated..

    Thanks
    -Prashant
  3. std::for_each is not compiling with boost::algorithm::to_lowe

    Hello,
    Do you guys know why this does not compile?
    <code>
    std::for_each(v.begin(), v.end(), &boost::algorithm::to_lower<string>);
    </code>
    v is a vector of strings that I want to convert to...
  4. Replies
    11
    Views
    1,888

    Re: Inheritance and Implementation hiding..

    Thanks man..Thats what even I concluded..
  5. Replies
    11
    Views
    1,888

    Re: Inheritance and Implementation hiding..

    [quote=JohnW@Wessex;1998544]You'd be better with something like this.


    class BASE
    {
    public:
    virtual bool isEqual(const BASE& rhs) const = 0;
    };

    class Derived: public BASE
  6. Replies
    11
    Views
    1,888

    Inheritance and Implementation hiding..

    Hello Guys,

    I have to implement a class BASE which is abstarct and has a function called isEqual which ofcourse checks for equality..

    Now isEqual has to be pure virtual.

    Now bunch of derived...
  7. Replies
    2
    Views
    687

    string.copy

    Hello,
    Anybody have any idea why this is the signature.



    size_t copy ( char* s, size_t n, size_t pos = 0) const;

    of std::string.copy function.

    I mean why char* s should it not have been...
  8. Accessing and changing elements in a std::set

    class TestClass
    {
    public:
    TestClass(string name, string profession): _name(name), _profession(profession)
    {
    }
    bool operator <(const TestClass& testClass) const
    {
    ...
  9. Re: Why g++ fails to find correct overload in this case?

    Compilar is looking for a overload in the class, which it does not finds.
    and errors out..Because you can not over load a member function with a global function..
  10. Re: Why g++ fails to find correct overload in this case?

    Use this...


    ::write_binary( n, f );
  11. Replies
    14
    Views
    6,753

    Re: A Design problem

    1. If I was to design, I would not keep data member in Abstract Class, which is Item.

    2. I will keep class hierarchy something different, and not based on Item but based on type.

    For example...
  12. Replies
    7
    Views
    954

    Re: Copy Constructor.

    What is tthis doing in your code?



    delete [] this->dataptr;
    size=source.size;
    dataptr=0

    1. Role of constructor is to initialize and not destruct....
  13. Replies
    5
    Views
    738

    Re: Inheritance problem

    First thing..
    Why following does not work?


    c=c+d;


    because here c+d will return object of type A.
    While c is object of type B.
  14. Re: how to detect NULL bytes in a char array ?

    If you have to find whether there is a NULL.

    You could do soemthing like the following..

    char buffer[1000000] = {'\0'};
    ....
    bool detected = strlen(buffer) < 1000000;
    I think...
  15. Re: An Object Oriented Question about C++

    Thats called constructor initialization list.
    This will ensure that all the data member are initialized before you hit constructor body.

    If you dont do that, all the data mambers will be...
  16. Replies
    5
    Views
    1,458

    UTF8 length calculation

    Hello guys,
    I am trying to write a code to find out no of characters in a multibyte UTF8 encoded string.



    #include<stdio.h>
    #include <stdlib.h>
    #include <iostream>
    #include <sstream>...
  17. Replies
    18
    Views
    1,992

    Re: Constructor initialization problems

    So what is the problem?

    Moreover, if you passing big vectors around..Better use reference to pass around Vectors..
  18. Re: does c++ map find function support multithreading?

    >>Unless the write operation is atomic.

    And how could it be atomic in STL map..?? Ofcourse when not properly synchronized...
  19. Replies
    6
    Views
    1,622

    Re: Attempting better multithreading design

    All I can say is revisit your design..

    With this current design you can hardly do much.
  20. Replies
    5
    Views
    1,417

    Re: Locking An Entire Class

    See...Your threads must be running on some condition...

    something like this..


    void svc()
    {
    while(isRunning)
    {
    //do something.
  21. Replies
    5
    Views
    1,125

    Re: Access private function

    No No..

    Here you are exposing RunIt just as a test hook. I want no test hook.

    If you do that any production code could define RunIt and will start accessing private data/member function.
  22. Replies
    5
    Views
    1,125

    Access private function

    Hello Guys,

    I want to access private function from outside of the class..
    I know its not allowed. But the thing is I need to test private function.

    I need some kind of hack, because its not a...
  23. building using shell file is giving error

    Hello Guys,

    I am facing a strange problem.

    My shell file build.sh contains



    g++ -o Client *.cpp -I ../ace5.5.static -lACE -L ../ace5.5.static/ace
  24. Replies
    33
    Views
    12,430

    Re: how to convert a string to a class name ?

    And now what I am gonna do with void* obj..? KHI KHI KHI KHI...:):)
  25. Replies
    33
    Views
    12,430

    Re: how to convert a string to a class name ?

    yup...Common base class is nessessary in that case..
Results 1 to 25 of 274
Page 1 of 11 1 2 3 4





Click Here to Expand Forum to Full Width

Featured