135 Topics

Member Avatar for
Member Avatar for nocloud

I've been scratching my head for quite some time with the following compilation error and I was hoping somebody could shed some light... I have the following in my header (.h) file: [CODE] //the mem_data class======================================// class mem_data : public reader, public date { //multiple inheritance public: mem_data(int,int,std::string); ~mem_data(); private: …

Member Avatar for caut_baia
0
378
Member Avatar for vTr

Hey there, I was wondering if anyone had the time to look over my code and give me some tips or tweaks to help me get it running. The program is all about inheritance, where i have the derived class using the base class clockType (with using strings) to add …

Member Avatar for mrnutty
0
620
Member Avatar for mklein

Dear all I am making a program which adds lots of jlabels to a frame (the idea, eventually, is that each jlabel will link to a different program on my dekstop) The trimmed down code below shows that I have a script which creates an array of multiple jlabels which …

Member Avatar for JamesCherrill
0
296
Member Avatar for daianahoney

Hello forum. I cant figure out how to overload the '+' operator or maybe theres another error? Im posting from phone so excuse the slopyness. Thanks! [CODE]#include <iostream> #include <string.h> #include <ctype.h> using namespace std; class Ferma { public: static int nr_rate; static int nr_gaini; static int nr_porci; static int …

Member Avatar for daianahoney
0
233
Member Avatar for bleedi

Hiya, I've got a small problem. I have an interface called "event", which represents a networking event. I have classes implementing this interface. Now, when my server app receives a new event, it checks the class of the event and acts accordingly. This works nicely when the implementing classes are …

Member Avatar for bleedi
0
156
Member Avatar for lacoffo

Hey all:) I'm learning Java and I'm having a little trouble on a polymorphic write-to-file function. Let me quickly explain my project: I have an abstract class Mammal, with non-abstract children Horse, Cow etc. I have a Main program that creates a couple Horses and Cows, and store these in …

Member Avatar for lacoffo
0
256
Member Avatar for n0de

Hi, i have some issues with class inheritance and i do not know how to solve it, maybe someone could help me with that ? [CODE] //pentathlete.h #include <iostream> using namespace std; template < class T > class pentathlete { protected : T comp_res [ 5 ] ; /*private: int …

Member Avatar for n0de
0
154
Member Avatar for HiHe

This works with Python 2.7 [code]class B: def __init__(self, arg): print(arg) class C(B): def __init___(self, arg): super(C, self).__init__(arg) c = C('abc') # abc [/code]Here super() gives a TypeError: must be type, not classobj [code]from math import pi class Circle: """with Python3 object is inherited automagically""" def __init__(self, r): self.r = …

Member Avatar for HiHe
0
278
Member Avatar for 650U

I have a question in Inheritance(Python): Write a class named Person with data attributes for a person's name, address, and telephone number. Next write a class named Customer that is a subclass of the person class. The Customer class should have a data attribute for a customer number and a …

Member Avatar for e-papa
0
228
Member Avatar for Rimojenkins

Hello. I'm currently making a program that deals with a priorityQueue and inheritence/polymorphism. Student -> undergrad -> coop_student or student -> grad Now, the queue takes in the data and just puts it in a linked list and gives it a priority. That way, there are 3 queues and we …

Member Avatar for LevyDee
0
261
Member Avatar for zaneulhaq

Hey guys i'll show the code first then explain my problem: [code=c] Class A { /*Variables required by A, B, C and D */ /*functions required by B and C*/ }; Class B { /*some of it's own functions and variables*/ }; Class C { /*some of it's own functions …

Member Avatar for Stefano Mtangoo
0
387
Member Avatar for ispeakbinary

I am learning c++ now and have encountered a problem in trying to create single digit addition, multiplication and subtraction math questions. The numbers used in the questions are randomly generated from 1 to 9 and when I try to print the answer for the corresponding question, I get a …

Member Avatar for prvnkmr194
0
192
Member Avatar for Colezy

Hi all, I am creating an application that includes and calls upon someone else's code. I need to slightly change the functionality of a constructor in their code but the class I need to change is buried away very deep. I considered inheriting from the class so I could change …

Member Avatar for Colezy
0
114
Member Avatar for Labdabeta

I need a few helps for some things that I just cannot get the syntax of! (I need these, and if you don't believe me I can post the reason) 1) Creating a function within a function 2) Creating a class within a function 3) Declaring a template function outside …

Member Avatar for mike_2000_17
0
124
Member Avatar for Labdabeta

I am working on making a 'safetype' abstract class, which will have a complete set of pure virtual operator overloads to help make sure that a class inherited from it is safe to pass to virtual any function. The problem is that I don't know the syntax of a pure …

Member Avatar for Labdabeta
0
236
Member Avatar for emcyroyale

Basically this program uses an abstract class which 3 other classes extends to so that in the end an overridden toString() method will print out how many pages must be read for each class. Okay, well this program is for a class, but I am kinda of stuck because my …

Member Avatar for quuba
0
202
Member Avatar for anuj_sharma

Hey Guys, I have the following code: [CODE] class A { int a,b; A(int i,int j) { a=i; b=j; } void showab() { System.out.println(a+" and "+b); } } class B extends A { int k=20; void showabk() { System.out.println("a="+a); System.out.println("b="+b); System.out.println("k="+k); } } class Test { public static void main(String …

Member Avatar for anuj_sharma
0
90
Member Avatar for RobZombie85

Hi Iam running into a problem when using classes and inheritance. I have a base class which contains a member function whos job it is to create and intialize some variables that are shared between other classes. The other classes are inherited from the base class and the variables are …

Member Avatar for Narue
0
138
Member Avatar for curbster

Hi all, I'm almost done with a problem for a java class I'm taking. The chapter I'm studying is on inheritance and I think I understand it ok. The parent class will compile fine, but when the child class tries to compile I get an error saying it cannot find …

Member Avatar for curbster
0
455
Member Avatar for arthurav

I have the following program : [CODE] #include<iostream> #include<string> #include<conio.h> using namespace std; template <class T> class matrice { T **a; int m,n; public: matrice(); matrice(int,int,int); matrice(char *); matrice(int,int,T **); matrice(matrice &x); ~matrice(){}; template <class U> friend ostream &operator <<(ostream &,matrice<U> &); int getNrLinii(){ return m; } int getNrColoane(){ return …

Member Avatar for Fbody
0
187
Member Avatar for Brianbc

I need some help with inheritance in php. The code below does not produce any output. [CODE] Class Father{ var $car; Function inherited(){ print $this->car; } } Class Son Extends Father{ Function __Construct(){ $this->car='Benz';//I'm assuming here that car is still a property of father. } } $obj= new Father; $obj1= …

Member Avatar for Brianbc
0
118
Member Avatar for gilly231

I need help with an assignment for my programming course. I have three classes A,B,C. all stored in one array. (These are not my real classes there are just a guide) [CODE=c] Class A{ char name; public: virtual print(){ printf("%s",name); } } Class B : public A{ char middleName; public: …

Member Avatar for gilly231
0
191
Member Avatar for sirlink99

I am having some trouble on inheritance in java. I am just testing how it works. I have a file that produces a random number in a folder called number. I have a file that calls the RandomNumber code that is in the main folder. I am wondering how I …

Member Avatar for pbl
0
86
Member Avatar for mani_1991

I have a situation like this... I have four different tables namely btech_ece, btech_cse, btech_it, btech_eee all these tables have the same columns. Its just that the name differs and everything else is same. Their columns are:- Id Year Semister Section Period SubjectCode Date Status now i have four different …

Member Avatar for pbl
0
180
Member Avatar for roro-

Ok it's all about to create 4 class Class a , class b derived from a and c derived from b and test class Speed is an instance variable in class b and c. The method are : Start() -a method of all class to print the message"hee" override the …

Member Avatar for roro-
0
245
Member Avatar for sharkpit

this is the summary of program and i only include the addition of matrices my problem would be the variables in Addition class cannot read variables from the other class i need to know how to fix that the error would be : The name 'a' does not exist in …

Member Avatar for Mitja Bonca
0
122
Member Avatar for Tsunami49

Hi there. I am currently trying to get my head around using classes across two files. I currently have a super class and a sub class stored in a file and the main function in another. When I try and pass arguments to the class they work fine if the …

Member Avatar for Tsunami49
0
135
Member Avatar for ace8957

Hello all, So I'm working on this simple program with a Queue class template that is publicly derived from the abstract base class CharQueue. The only problem is that I keep getting hit with the error "expected class name before '{' token". The reason I don't understand this is that …

Member Avatar for Fbody
0
711
Member Avatar for PerplexedB

[CODE]Partial Class system.windows.forms.control Overridable Sub ioEnabled(ByVal mode As ModeValues) End Class[/CODE] ... gives me a zillion errors. Is there a proper way to "expand" a system class?

0
83
Member Avatar for PerplexedB

VB2008 won't let me drag my lblBase class from the toolbox onto a form in design mode. Why? Is there a way around this? [CODE]Public Class lblBase Inherits System.Windows.Forms.Label 'Public Sub New() 'MyBase.new() ' Me.BackColor = Me.Parent.BackColor 'End Sub End Clas[/CODE]

Member Avatar for JJCollins
0
124

The End.