462 Topics

Member Avatar for
Member Avatar for Buolbear4444

So, I'm writing a roguelike game in C++. But, its complaining about a class I made called "Player" in the file "player.h" in the file "monster". When I input into monster this function: [CODE] void attackplayer(Player& hero, bool checkup, bool checkdown, bool checkleft, bool checkright) { if (checkup == true …

Member Avatar for Buolbear4444
0
184
Member Avatar for gendler.max

Hello, I have a question on how to use a class similar to the Grid Class included in the Lawerence Press textbook on C++. The question is, do I have to have the InitGrid function in every paint or no?

0
93
Member Avatar for mgn2683

I have an issue where my content has two different classes assigned to it: left and right. The left column is perfect, but the right column which holds my text begins at the bottom of the first column. Please look here for more: [URL="http://mgndesign.com/draft/"]http://mgndesign.com/draft/[/URL]. Feel free to look at the …

Member Avatar for mgn2683
0
126
Member Avatar for b89smith

I have written two different classes that are in two different files one is LoadData.java and the other is csvReader.java both are in the same folder. In the class LoadData I try to use a public function in csvReader by calling csvReader.getData(), when I compile LoadData, which is after I …

Member Avatar for leiger
0
135
Member Avatar for stevebush

Hi, I am working on assignments that deal with Generics in java. I have a class Movie that have a String name variable. However I have to add a few more properties to Movie objects like Release year and Director name. So I created an Inventory class that uses the …

Member Avatar for JamesCherrill
0
104
Member Avatar for iamcreasy

This class when, it is not integrated with the main program, shows the following error....and I have no idea what it is trying to say.. :( :( [code] #include "character.h" Character::Character(DrawEngine *de, int s_index, float x, float y, int lives, char up_key, char down_key, char left_key, char right_key) : Sprite(de, …

Member Avatar for iamcreasy
0
156
Member Avatar for tyson.crouch

G'day, Just a simple question. Does MySQL Support Inheritance? I understand that both Oracle and PostgreSQL support Inheritance, but haven't seen anything in MySQL regarding this. Regards, TC

Member Avatar for griswolf
0
119
Member Avatar for LloydFarrell

Hi, im still pretty new to PHP and I have just started looking into classes / functions and OOP - I have done loads of searching and watching tutorials and learning from others here on daniweb with great pleasure, I was hoping that someone could fix the problem im having …

Member Avatar for rajarajan2017
0
228
Member Avatar for zreed

I need to code a program for my friend and it has been giving me some difficulties. This needs to have two classes, one called Tester and another called Game. And the data in the Game class needs to be pulled to the tester class after the calculations are finished. …

Member Avatar for jwenting
0
291
Member Avatar for xx_kandikidd_xx

Hi, I'm having trouble with my Java code. It's meant to read in from a csv file and update the elements on the GUI to reflect this e.g. as it reads in one line, images and text appear on the GUI reflecting the data. Anyway, to get the GUI to …

0
94
Member Avatar for marco64

Hello, I would like to know if you know any framework/classes for systems administration in windows/linux environment. Thanks for you replies! Bye, Marco.

0
142
Member Avatar for vivosmith

Hi I found this example on about.com . I understand most of this, but one part is giving me problems in genral. I tried classes before, and it did not go over so well. But since this is someone else code, it might be better than mine :). Thanks [CODE] …

Member Avatar for Fbody
0
101
Member Avatar for corby

hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { …

Member Avatar for Ancient Dragon
0
161
Member Avatar for sah15

Hi, I'm supposed to create a program where I want to purchase tickets to a theater based on rows and columns of the seats. The program uses two-dimensional arrays and constructors, and is supposed to display somethine like this: "ASU Gammage Theater 1. View available seats 2. Request tickets 3. …

Member Avatar for Lerner
0
233
Member Avatar for enigmaYes

Hey guys. This is an assignment I've been given by my professor for a C++ course. The assignment description is below: [COLOR="Green"]Create a class ThreeDShape that has a default constructor and pure virtual functions double getSurfaceArea(), double getVolume() and void print(). Function getSurfaceArea() should compute and return the surface area …

Member Avatar for NathanOliver
0
242
Member Avatar for maddav

Hi, just a quick question (i hope!!), i'm working on an assignment where i need to build a user-defined library of shapes. The class structure is to have "shape" as a base-class with both 2d and 3d shapes as derived classes. I've handled this by storing them in a vector …

Member Avatar for maddav
0
620
Member Avatar for Kevin_160

Hi Everybody, I have succeeded in parsing the values I needed from a text file and storing them in an array. The script I've posted works as a function, but now I tried to put it in a class and I can't figure out how to define the constructor. The …

Member Avatar for mrnutty
0
2K
Member Avatar for dragonflare

[CODE]#include <iostream.h> #include <fstream.h> #include <stdlib.h> #include <string> using namespace std; //const int MAX_SIZE = 10; //char determine_grade(int smarks); class student{ public: student(); //constructor ~student(); //destructor //char grade; //set values void set_mark(int); void set_id(string); void print_students_records(student, int); //get values int get_mark(); string get_id(); private: int mark; string id; }; //void …

Member Avatar for NathanOliver
0
164
Member Avatar for vivosmith

[code=C++]#include (iostream.hpp) class Stocks { public: Stocks( int price); ~Stocks(); int get_price() const {return pps;} int set_price() const {pps;} int the_price_is (int pps); int pps; } int main() { Stocks AMX (35) cout << " Hello, please enter a symbol.\n"; if cin>> AMX; cin.ignore; cin.get; AMX.the_price_is cout<<" 35.\n"; return 0; …

Member Avatar for Fbody
0
116
Member Avatar for sah15

I'm having troubles with a code for a program (involving classes) where I am supposed to input the three sides of a triangle and the program determines whether the triangle is a right triangle, equilateral, isosceles, and scalene, etc. I have only one error preventing me from compiling my program, …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for melissa2185

What I need to do is using classes, design an online address book to keep track of the names, address, phone numbers, and birthdays of family members. The program should be able to handle a maximum of 500 entries. a. Define the class Address that can store a street address, …

Member Avatar for Ezzaral
2
258
Member Avatar for corby

hi in my drive file this is what my constructor looks like. im passing an array to it the constructor so that i can assign it to set[num]. what i want to know is what would this look like in the header file? drive-file: [CODE]IntegerSet::IntegerSet( int a[]) { for ( …

Member Avatar for Sodabread
0
205
Member Avatar for jk8204

I need to design a class to represent an oven control unit containing: - Three constants (COOK, BOIL, SELF_CLEANING) with values of 1, 2, & 3. - Boolean value 'on' to represent oven is on or off - Int value for cooking temp, actual temp, and cook time (in min) …

Member Avatar for Katana24
0
120
Member Avatar for musikluver4

The code below is the file for the constructor method and the get methods [code] //Date: 3/18/2010 public class Taxpayer { private int socSec; private double yearlyGross; public Taxpayer(int taxPayer, double income) { socSec = taxPayer; yearlyGross = income; } public int getSocSec() { return socSec; } public double getYearlyGross() …

Member Avatar for javaAddict
0
175
Member Avatar for FlippA

Hi all, I have a list of Classes and I want to sort the list of Class by one of the Attributes held within the Classes does anyone know a easy way of doing this. Kind Regards FlippA

Member Avatar for FlippA
0
150
Member Avatar for jonyb222

Good evening Daniweb, I have another idiotic problem which comes from making an arrival subclass out of Event. I have a few other subclasses of Event and they aren't giving me any trouble. I have tried to copy/paste/rewrite to eliminate any stupid typos. Arrival.h:7: error: expected class-name before ‘{’ token …

Member Avatar for jonyb222
0
553
Member Avatar for cog_bn

Hi, I've got a problem with a program that boils down to strange behavior by the vector container class. It seems to not want to call constructors enough but calls destructors too many times: [CODE] #include <vector> #include <iostream> using std::cout; int constructor_count=1,destructor_count=1; class obj{public: obj(){ cout<<"C: "<<constructor_count++<<'\n'; } ~obj(){ …

Member Avatar for vijayan121
0
631
Member Avatar for nukes88

Hi, i have a problem, i am using a library given by my university to create a game, these are my classes and cpp files, and i am getting this error: error C2512: 'Board' : no appropriate default constructor available, pls help. [code] class Board { protected: GWindow &Gwin; int …

Member Avatar for jonsca
0
166
Member Avatar for fadia

I'm working on this program. There are 3 classes. These two classes [COLOR="Red"]PassengerMenu and SecurityMenu[/COLOR] are inherited from the class [COLOR="Green"]MainMenu[/COLOR] So the main menu would provide the logo and a description (normal cout). Also an access to either the passnger menu or the security menu. according to your choice. …

Member Avatar for fadia
0
165
Member Avatar for crh0872

Hello again DaniWeb! I'm designing a dynamic website in PHP, and it's structured so that each page creates the necessary objects (based on what content is being viewed) which get the right information to display. Smarty then organizes this content and makes it look good. The problem is, I have …

Member Avatar for diafol
0
122

The End.