Sure, I agree about the use of overridden functions is polymorphism in the way you describe, but isn't the ability to treat the different objects (not their methods) as the same an example...
Type: Posts; User: Nereus
Sure, I agree about the use of overridden functions is polymorphism in the way you describe, but isn't the ability to treat the different objects (not their methods) as the same an example...
Thanks for the reply laserlight! But doesn't polymorphism mean that the members of a derived class are treated like those of its parent (or so Wikipedia says), whereas in my case it's the actually...
If I have an array of pointers to objects of different classes that are derived from the same base class, is this an example of abstraction? :confused:
Thanks for the info, Salem. The code is several thousand lines and I have no idea where in the code the problem is (as that's what I was using the profiler for), so I can't post any code,...
I think I may have found the reason for the empty data file... It seems that most of the runtime is due to system overhead, although I don't know why this is so. I don't write/read from files much or...
Yes, I looked there, but what I'm saying is that I can't find the information I need in that documentation...
I just found this in my file, which corroborates your idea: I searched for...
There's the online documentation, although I can't find any relevant information in that. Perhaps I'm looking in the wrong places, or perhaps it's not there...
I'm using gprof to profile my program. I run the program and produce the file gmon.out, which I interpret with gprof. The result is a text file with my profile data in. However, while there is data...
The latter is exactly what I wanted. Thanks, laserlight!
class MyClass{
public:
MyClass(int MyInt,char MyChar){i=MyInt;c=MyChar;}
~MyClass(){};
private:
int i;
char c;
};MyClass doesn't have an explicit default constructor. Say I want to...
size() would tell you how many elements you have. To refer to the last element of a vector use back().
Thanks CodePlug, you were exactly right, it was a problem in the destructor. I guess I should've checked there first...
Hi there,
I have an array of pointers to objects, and I wish to delete an object pointed to by one of the elements. However, when I try to do this using delete MyPtrArray[2]; my program crashes at...
Hi there,
I would like to produce a graphic from the contents of a matrix, specifically, a grid where the colour of each cell represents the value of the corresponding matrix element. Are there...
Hi there,
I would like to know whether C++ has an equivalent function to Fortran's intrinsic MOD(A, P), i.e. a function that returns the remainder of a division. I realise that such a function is...