User Profile
Collapse
-
finally the cd recognized the windows installation and it started repairing it. However, when it reboots and gets to the installation screen, it start the process and then it gets stuck at 'installing devices'. It does not continue. -
That command is not recognized in windows recovery console. Keep in mind that I cannot log into safe mode either.Leave a comment:
-
How to recover Windows xp after crash from system restore
A few days ago, I got a virus in my windows xp home edition that was redirecting links on my browser. So I ran across a post that directed me to run AVG virus scanner in safe mode and then to turn off system restore, then restart to normal. I did as directed. I got the blue screen with the code c000021a. In my effort to fix this, I ran across a video in youtube that told me to delete system32\config \system without backing it up!!!!!!!! Now I am getting... -
Thanks a lot Oralloy. This is one of the most precise answers I have received.Leave a comment:
-
So its best to make all base class methods virtual in case they will be overridden. Is that right? I also understand that after the first virtual method, subsequent ones do not take up much memory. Thanks.Leave a comment:
-
Virtual Methods
In the following program, why is the bird's fly method stated as virtual when its implementation is not overridden by any other class method. I thought we only state a method as virtual when you will be overriding it.
Code:#include <iostream> using namespace std; class Horse { public: Horse() { cout << "Horse constructor... "; } virtual ~Horse()
-
You're absolutely right about books. I tried to contact the author of the book and his email is no longer valid. I am going to make the changes you've posted and report back. Thanks.Leave a comment:
-
Thanks for the explanation. But I am trying to understand the code in this book that I am learning with i would like to know if I am understanding this specific code correctly.Leave a comment:
-
I think I finally understand this correctly thanks to newb16 and others. Please see my comments in the code below and let me know if I my understanding is right or wrong. Thanks for your patience with my rather long comments.
Code:#include <iostream> using namespace std; class Mammal { public: Mammal():itsAge(1) { cout << "Mammal constructor...\n"; } ~Mammal()
Leave a comment:
-
Thanks for the explanation newb16. I now understand that the new Dog gets its age copied to it inside the copy constructor. So when the Dog clone() method is called, I see 2 events take place:
1. A new Dog object is created on the free store.
In between these two steps, the Mammal copy constructor is called first with the address in *this and then the Dog copy constructors is called with *this. And inside the copy constructor,...Leave a comment:
-
Thanks for the responses. But I am sorry, i'm still not getting the complete picture. Let me know if this is correct: in the virtual function:
virtual Mammal * Clone(){return new Dog(*this)}
It creates a Dog object on the free store and assigns the calling object's contents to this newly created Dog. Then it returns a pointer to a Mammal. Then this pointer is stored in OtherArray[i] which will iterate to display all the...Leave a comment:
-
virtual copy constructor
I have been plunging my brains trying to figure this out all day today...Its 2 am now. Please, someone explain the following to me: I know the virtual clone method is there in each class to facilitate the use of virtual copy constructors since you cannot directly declare
*virtual Mammal (const Mammal & rhs);* in this manner. However, I cannot understand what the clone method is doing. Lets say for example, at the prompt, I enter 2. Then... -
-
Thanks a lot. This is a watered down version of a more complicated code. Basically, I needed to know why the constant and you answered my question mostly. However, one thing I still need to grasp: So if i put in the number 3 into theArray, the program could accidently change that value?Leave a comment:
-
Constants in Arrays
Hi, please see questions below. And thanks in advance.
Code:#include<iostream> using namespace std; enum ANIMALS { MAMMAL, DOG, CAT}; const int NumAnimalTypes = 3; //Whats the purpose of this? int main() { int theArray[NumAnimalTypes]; //Why not put 3 here instead of NumAnimalTypes? Does it have something to do with constant? int choice, i;
-
Banfa, as you mentioned, I got rid of system pause and did ctrl+f10 on dev c++ and the prompt just does not stay up. So I kept holding ctrl+f10 and I saw a glimpse of the destructor being called. Also, I tried it in MSVC (without system pause or cin.get()) with ctrl+f5 and it shows the destructor being called. So I understand that the destructor is called only when the object is destroyed or when main exits and main does not exit if you have system...Leave a comment:
-
Constructor/destructor
The code below does not show the output when the destructor is called. It shows when the constructor is called, then it shows the age. Then it finishes. Am I doing something wrong here? Thanks
Code:#include <iostream> using namespace std; enum BREED { YORKIE, CAIRN, DANDIE, SHETLAND, DOBERMAN, LAB}; //global enumeration class Mammal //This is the base class {
-
Thanks for the detailed response. I didn't mean to shout. I was just trying to make the question stand out. I have made the proper changes.Leave a comment:
-
I fixed the overloaded prefix operator but the post fix does not work. It outputs 0... And a new question arised: //Why not make the postfix function return a reference like the prefix function? This way, we could just return '*this'. I tried and it works. Is this ok to do? If so then why did the author go thru the hassle of creating a temp object and returning by value?
Code:const Square & Square::operator++ () { ++(*itsSide);
Leave a comment:
-
Thanks for helping Banfa. I understand almost all your explanations. However i don't know how to fix the problem. I hate asking for answers. So maybe you can give me a hint as to what is wrong in the operator++ function?Leave a comment:
No activity results to display
Show More
Leave a comment: