462 Topics

Member Avatar for
Member Avatar for dimProg

Hello, I'm new to c++ and we're just starting classes and objects in class. I've done a bit of programming in Java and I'm struggling to initialize an object using a variable. I must be missing something fundamental but I can't for the life of me figure it out. Here's …

Member Avatar for rickster11
0
1K
Member Avatar for zeeya

Hello.. I'm new with java and have some problem with my assignment. I want to write a class named phoneBookEntry that has field for a person name and phone number. The class should have a constructor and appropriate accessor and mutator method. Then, write a main class that create five …

Member Avatar for peter_budo
0
1K
Member Avatar for jmwmulle

I'm an amateur web developer trying to move toward more professional coding practices, and I'm making my first site that makes extensive use of ajax. I've used the xmlHttpRequest object on a few occasions, for which simply creating functions as I needed them were adequate. But the site I am …

Member Avatar for jmwmulle
0
233
Member Avatar for JeremyK2

I have a class that stores all of my variables and functions (for our purposes, DataClass), and a few different windows form classes that use the public variables and functions in DataClass. I need to keep the values of the public variables in DataClass until the program closes. I set …

Member Avatar for rxlim
0
205
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
146
Member Avatar for iamthesgt

This may be a simple fix, but I have a class for a program that contains some member functions that manipulate a vector. The vector is a private member variable, and is filled from an array using a constructor. When I try to access the member functions to manipulate the …

Member Avatar for iamthesgt
0
172
Member Avatar for iamthesgt

When writing a program that uses separate compilation (I have a header file, a .cpp file that declares all the member functions of the class in thee .h file, and an application file). I used a constructor to pass the contents of a dynamic array to a vector, but it …

Member Avatar for iamthesgt
0
283
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
463
Member Avatar for iamthesgt

Okay, we had an assignment in computer class that I have been working on for awhile but what I've got so far isn't working. It seems that it may be a compiler issue, but since I can't get to a linux compiler (what the program will be evaluated on), and …

Member Avatar for iamthesgt
0
169
Member Avatar for becool007

Hey so my project is an Average Calculator to calculate the average of a set of numbers. Anyways, I must make it in a GUI and I have chosen Win32. My problem now resides while trying to do the following: - When there is a paint request, to paint anything. …

Member Avatar for becool007
0
177
Member Avatar for chipsch

I have an assignment where I have been asked to ask the user for input. What I am trying to figure out is if there is anyway to call and use methods of another class whose constructor requires parameters without passing them from the main class that will be calling …

Member Avatar for Akill10
0
215
Member Avatar for george61

There is a working code about a program in which you should create differen Cat objects with name and color parameter and apply method to the objects. The problem is that I get the method working for only the last cat [CODE]public class Cats { public static String name; public …

Member Avatar for masijade
0
228
Member Avatar for warlord902

I configured a logger namely "My Log" in my main class which can write errors in a log file named mylog.txt Now I want to use this same file for all packages and classes there in. I tried to put this in other class Logger.getLogger("My Log") //Did nothing Now what …

0
130
Member Avatar for minigweek

Hi Folks, The page on which my userscript will run has a namespace, the namespace defines a constructor function. I would like to create an object using the same constructor and use methods of the object in my userscript. So far I have been unsuccessful. Here's what I am trying …

0
79
Member Avatar for trebor-pl

Hi, i'm not very good at OOP, basically just started it. My program basically its like a system for a game shop, the main isn't fully done yet, however main isn't a problem. The other files must contain some kind of problem in them. Well enough of the talk, I'll …

Member Avatar for trebor-pl
0
338
Member Avatar for BanKuZ

hi all, I have a class A that has a char* var, operator and methods. In addition I have a global func(char*s). I would like to run this code from the main function by adding operators to my class, I need help writing them. [CODE]A* pA; ... A** ppA = …

Member Avatar for BanKuZ
0
256
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
120
Member Avatar for linux

[B]Ah! Never mind! I forgot you could embed classes such as:[/B] [code]class Heroes(): class Lords(): class Phill(): hp = 25 >>> Heroes.Lords.Phill.hp 25[/code] ------------------------------------------------------ I am attempting to write an RPG in Python. I am not worrying about the battle system or mapping quite yet, and am more focused on …

Member Avatar for richieking
0
5K
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
193
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
87
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
182
Member Avatar for gth759k

About a year ago, I built a simple ray tracer in Java, and now I'm trying to port it to c++, but I can't figure out how to get a couple of my classes to work together. It should be fairly strait forward, but its not working. Here is a …

Member Avatar for gerard4143
0
3K
Member Avatar for 100gram

Hello! Considering the competition on "classes"-related keywords is it realistic to create good SEO - first page on Google - and if so how long will it take?

Member Avatar for Living-seo-life
0
134
Member Avatar for J0shu

Hello everyone. I've been trying to implement a linked list in C++. I found this implementation on the web, where they created a struct for the list's nodes. When trying to add a new node to the list, I get this error: [B]List.C: In member function `bool Linked::addNode(Point)': List.C:23: error: …

Member Avatar for jonsca
0
547
Member Avatar for stevetaylor15

I was just a bit confused about something sorry. If you have two classes, Ribbon1 and ThisAddIN below. How can I call Example()? - All are in the same namespace.. [CODE] public partial class Ribbon1 { private void button1_Click_1(object sender, RibbonControlEventArgs e) { //Call Example() from ThisAddIn Class Example(); } …

Member Avatar for williamrojas78
0
202
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
246
Member Avatar for robotlogik

hi. i need help for a problem. i have an array of double values in the main method. i am trying to create an object and pass the array to a different class using an overloaded constructor. i am having trouble with the syntax. please help, i need to use …

Member Avatar for robotlogik
0
192
Member Avatar for penguins10

Hi, I have a homework assignment that I just cannot figure out. I would be grateful of any help. The assignment is: Create a program which: Implements a class called Queue: The class should contain an array of maxQ integers. There should be two constructors: One that takes no argument …

Member Avatar for Zeeshan Cheema
0
241
Member Avatar for morewater14

Hi, I have a project to do for a C++ class that asks us to use a class termed "queue" to store some values (20/100/user defined) and allow the user to add/remove values. I'm sure it seems really basic, but I just can't get my code to display the class. …

Member Avatar for Fbody
0
180

The End.