User Profile

Collapse

Profile Sidebar

Collapse
Suresh369
Suresh369
Last Activity: Nov 2 '06, 11:44 PM
Joined: Sep 12 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Suresh369
    replied to C++ shared objects
    in C
    OK, I admit I dont know anything abt linking. This is the question I have.

    Say I just have the .so file of another C++ program and dont have access to the source code (.h or .cpp). How do I inherit a class in my current program just by linking the .so file?

    First of all, is it possible?

    This is the situation I was in in the above post.

    I tried to compile my program using :
    g++ -shared...
    See more | Go to post

    Leave a comment:


  • Suresh369
    started a topic C++ shared objects
    in C

    C++ shared objects

    I have written a program which inherits a calss from a different shared object. I have linked that shared object when I compile my program using the -shared <path>/blah.so

    My question is how exactly do I include the parent class in my program. When I tried to use

    #include<parent .h>

    class child : public parent {

    }

    the compiler complains. The class parent is in blah.so...
    See more | Go to post

  • Suresh369
    started a topic How to run an executable from C++
    in C

    How to run an executable from C++

    I have a need to run an executable from C++ code. And get the output of the run for some processing in C++. How do I do that? Does C++ support system command like Perl?
    See more | Go to post

  • Suresh369
    started a topic C++ memory usage
    in C

    C++ memory usage

    I have written a program in C++ where lot of dynamic memory allocation is done. I wanted to know how to measure the memory consumption of my program when I execute it and other metrics like the load on the CPU etc. I work on Linux env. Any pointers to detailed performance analysis would be greatly appreciated.
    See more | Go to post

  • Suresh369
    replied to Virtual Function override
    in C
    Thanks! But sorry, the more I read about virtual functions, the more confused I am

    Lets take this example:
    class Window // Base class for C++ virtual function example
    {
    public:
    virtual void Create() // virtual function for C++ virtual function example
    {
    cout <<"Base class Window"<<endl;
    }
    };...
    See more | Go to post

    Leave a comment:


  • Suresh369
    replied to Virtual Function override
    in C
    But what if I have multiple derived classes which override the function, how will 2 work?...
    See more | Go to post

    Leave a comment:


  • Suresh369
    started a topic Virtual Function override
    in C

    Virtual Function override

    I am still a beginner in C++:

    Lets say i need to derive a class D from a base class B. And I have a need to override B's function called vulnerable()

    There are two ways I can do it:

    1. Normal override - Just re-define the function in class D
    2. Virtual Function Override - Delcare it as virtual in B and then override in B

    What is the advantage of one over the other?
    See more | Go to post

  • Suresh369
    started a topic Accessing Map elements randomly
    in C

    Accessing Map elements randomly

    HI,
    I have a need to randomly access a Map element.
    For this I tried:

    int entry ; //Randomly generated
    map<int, int> blah;
    map<int, int>::iterator blahI;

    blahI = element + blah.begin();

    But the compiler complains. I need to get an iterator to a particular element.
    Thanks
    See more | Go to post

  • Suresh369
    started a topic Reading unsigned int from command line
    in C

    Reading unsigned int from command line

    From the command line, I passed a value like this:

    a.out -seed 3333333333

    But when I did:
    unsigned int seed;

    seed = atoi(argv[2]);

    cout << seed;

    it just puts out the decimal equivalent of 0x7fffffff; I cannot change the internal variable to int. Any hints?
    See more | Go to post

  • Suresh369
    started a topic asigning ofstream objects
    in C

    asigning ofstream objects

    I have written this function in C++:

    MsgManager::Msg Manager(const string& module, ofstream& os)
    {
    _modulename = module;
    _os = os;
    }

    _os is a protected member of class MsgManager. Compiler complains that the "=" operator is private. Is there a way I can do this assignment?

    Thanks
    See more | Go to post
No activity results to display
Show More
Working...