The problem is to use recursion to count how many boxes are in a room. The trick is each box can have boxes inside of it and each one of those can have even more inside of it. It is supposed to begin...
Type: Posts; User: aciarlillo
The problem is to use recursion to count how many boxes are in a room. The trick is each box can have boxes inside of it and each one of those can have even more inside of it. It is supposed to begin...
Hi, I'm trying to instantiate a list using the stl and I want to instantiate the list as pointers of a parent class Transport. Transport however has abstract virtual functions and my compiler is...
ummm nevermind im an idiot, its late and i forgot my namespace :rolleyes:
My program keeps saying istream and ostream are not declared when I'm trying to create this class:
#include <iostream>
#ifndef TRANSPORT_H_
#define TRANSPORT_H_
alright yea i understand that my teacher just gave it to us as a diff name i guess. I still don't understand where I need the constructor or how to create the grandchild classes. Here is what I have...
include guards?
here is my transport.h
#include <iostream>
#include <fstream>
class Transport{
public:
virtual void output() = 0;
virtual void input() = 0;
Hi, I'm working on a basic program to practice working with inherited classes, parent - child and grandchild. The problem is the book for my class is awful and any examples I find online are far to...
anyone?
Okay I am creating a doubly linked list with simple functions for head insert, tail insert, head remove, tail remove and a few others. head insert and remove seem to be working fine and the tail...
okay still looking for some help on this... i am getting the above two errors on these two lines of code:
temp->next = head;
head->prev = temp;
those two lines are from a function which...
i keep getting this error in my code:
67 C:\Dev-Cpp\240c1\Dlist.template invalid use of member (did you forget the `&' ?)
68 C:\Dev-Cpp\240c1\Dlist.template invalid use of member (did you forget...
Okay, this is my first time working with doubly linked lists and I can't get past the first thing... doing a head insert.
here is my code for the insert:
template <class T>
void...
Okay this is my code and its pretty simple and self-explainatory. The problem is that this program must be running in the background at all times so I don't want it to use all my CPU power. I know...
Okay my parents asked me if it would be possible to write a program that can limit the time frame during which the internet can be accessed from my sisters computers. I haven't done any type of real...
I am writing a really basic program to mimick Sets using linked lists. I just made a small main() to test each of my template functions as I write them. The problem is my main is behaving very oddly...
so the new code would look like this:
template <class T>
class node{
public:
node<T>(){linkfield = NULL;}
node<T>(T d, node<T> *lf){datafield = d; linkfield = lf;}
yea that isnt the problem, i used the same node.h in another project and declared nodes the same way except instead of <T> i used other objects I had made like <Resident> and it worked fine. Any...
it is still saying 'ISO C++ forbids declaration of node with no type' , 'expected ; before < token' for this line in set.h:
node <T> * head;
any ideas?
Here us set.template which isnt done yet, I was just trying to see if my constructors and such worked before moving on. Using g++ compiler/minGW with dev-cpp. The end result will be compiled with g++...
I have a template node class that I have been using in some projects for creating linked lists with. Now I am trying to create a template class for working with sets. For some reason tho when I try...
I'm having some more trouble with this linked list stuff... my new problem is that my removeDirty() and removeClean() functions only remove nodes that are at the top of the list, not in the middle. I...
Alright I got it, I had never returned something by reference but I figured it out, thanks
Okay I have an object called Resident and it has fields for name and bill. In my program I am going thru a linked list of dirty laundry items and when i get each item I am trying to adjust the owner...
For some reason when doing anything with my linked lists I am getting a seg-fault. All of my linked list functions check to see if the head is NULL before adding or doing anything in the list to...