I need to use inheritance but I also need accessors & mutators
Do protected variables act like private variables but with inheritance?
If I use private and inheritance my subclasses can't find...
Type: Posts; User: TenTierHook
I need to use inheritance but I also need accessors & mutators
Do protected variables act like private variables but with inheritance?
If I use private and inheritance my subclasses can't find...
I am creating a very simple 2d game ...
My wall and item placements in the level are read from a text file.
I am unsure what type to read them into.
I was going to use predefined arrays but...
I am trying to read a file to create the structures for a small 2d game.
I am reading in integer numbers to construct the walls.
At the moment I am using getline and have each number on a...
Do I just use the abstract class header file as the mass blueprint with prototype functions for all subclasses and have the implementation in each subclass?
Basically I have a load of empty...
so I changed some of the code
Entity *entities[2];
entities[0] = new Player;
entities[1] = new Map;
I added all the main classes to entity as virtual
I think I got the general idea but I am still getting errors
in main
Entity entities[2];
entities[0] = new Map;
entities[1] = new Player;
In my player class header file
Many entities.. several map blocks.. several items... 2 players most likely
By iterator I mean for loop :/ ... think I used the wrong term there.
Assuming I have an abstract class entity with a...
I am making a game entity class for a 2d allegro game of mine.
The abstract class will be entity .. the subclasses will be player, map_blocks and items
The main reason I am using it is to have...
That worked.
Thank you. I am starting to realise that C and C++ integrate quite a bit.
I am using strings to read in from a text file using getline.
I am trying to print this string to the screen using the allegro game library calling the function textout_ex.
textout_ex
It...
knowing its 8 instead of 7 helps a lot sipher.. thats solved it methinks
that calculation makes a lot more sense now
You are quite correct brewbuck, I am familiar already with this idea for...
0 100 0010 0101 0101 0110 0110 0010 1010
Okay worked it out a bit more
0 100 0010 0101 0101 0110 0110 0010 1010
The first bit on the left is the sign
0 100 0010 0101 0101 0110...
closing and reopening the file worked
using
clear()
before, not after
seekg(ios::beg) also worked
Trying to get to grips with the idea of floating point.
Just looking to convert a binary to float.
The last 8 bits are the exponent.. right?
The most significant bit is on the right?
The first...
Im doing some simple fileinput.. I am having issues resetting the file read to the start of the file. Basically If I run the function twice it won't work, once is fine though! :/ . I tried .seekg()...
Excellent Idea actually.. thanks!
I am trying to read a formatted file where the first two characters in each line denotes the type of line it is, it's related to music.
For instance "T:" denotes its the title.
One song can have...
So if I use malloc/realloc I can make that dynamic?
rather then a static [100]
Then I can search by date first, then, if any dates overlap, check each object by room
For(amount of...
I am trying to create a ms-dos hotel booking system for college.
It is just an exercise.
I need to mimic checking for room availability. If a certain room is booked for a certain date I need to...
I am trying to create a hotel booking system.
Should I use a 2d matrix for rooms
and another matrix for the dates?
A cross reference, or is there a better way