8 Topics

Member Avatar for
Member Avatar for vishalonne

Hi All I have a query regarding constructor and destructor. How accessibility of constructor and destructor affects the scope and the visibility of their class. If someone give some explaination on this I will be thankful. Regards

Member Avatar for David W
0
257
Member Avatar for jongiambi

Hi I have a quick question about a program im writing. The bold part is where im stuck. As of now my output is correct. Just wondering how to delete the memory I allocated. The question asks: Let us say that you want to choose how many marks to enter …

Member Avatar for VernonDozier
0
344
Member Avatar for VernonDozier

I have an abstract class. I'm creating a large array in the base class, which appears to never be deleted because no destructor is called. My questions (obviously) are... * Why isn't a destructor called? * How do I fix it? #include <iostream> using namespace std; class A { protected: …

Member Avatar for mitrmkar
0
265
Member Avatar for Lucaci Andrew

Have some problems with the qt destructor. I'm working on QtCreator: here's the class: the .cpp #include "controller.h" Controller::Controller() { } Controller::Controller(MovieRepo *movrep, MovieValidator *movval){ this->movrep=movrep; this->movval=movval; } void Controller::addMov(int id, string title, string desc, string type)throw(ValidatorException){ Movie* mov=new Movie(id, title, desc, type); movval->validate(*mov); movrep->store(*mov); } const Movie* Controller::getById(int id){ …

Member Avatar for Lucaci Andrew
0
264
Member Avatar for lastbencher

Program: #include <iostream> using namespace std; class Rectangle { float len; float bre; public: Rectangle() {cout << "Rectangle constructed!" << endl; len=0; bre=0;} ~Rectangle() {cout << "Rectangle destructed!" << endl;} void setL(float L) {len=L;} void setB(float B) {bre=B;} friend float area(Rectangle rect); }; float area(Rectangle rect) { return rect.len*rect.bre; } …

Member Avatar for JasonHippy
0
166
Member Avatar for freedomflyer

I am running into (pretty serious) valgrind issues as I run my application. As far as I can tell, my BST has some memory loss, to put it rather clinically. I've tried to create the right destructor on my BST<T> class, which contains BSTNode<T> nodes (both are shown below in …

Member Avatar for mike_2000_17
0
582
Member Avatar for jeffw362

Hi, I'm having an issue in my program when I try to call delete in my destructor. Can someone take a look and see what I doing wrong? I've looked it over and over but I just can't figure out what's wrong. destructor code: [CODE] StudentRecord::~StudentRecord(){ // Destructor delete[] m_firstName; …

Member Avatar for mike_2000_17
0
187
Member Avatar for badllama

Last year I built a generic list, everything was good. This year I'm adding classes to the list. These classes have lists. Everything is okay until the program ends, then it crashes. If I comment out my list destructor the crash doesn't happen. So I'm assuming the destructors aren't unraveling …

Member Avatar for jmichae3
0
239

The End.