help plesae
Type: Posts; User: Strait
help plesae
I can't figure out why I keep getting a syntax error from these functions
NODE.H //holds a value. no problems with this class
-------------------------------
#ifndef NODE_H
#define...
problem solved. now I'm having another problem.....sigh
the goal of my program is to take in two sets of any regular data type (int, double, char, etc) then be able to manipulate them. so far I'm working on input and output, but it's not working. here's...
I'm writing a program that randomly creates a list of integers using a node class then splits the list at a certain value and sorts the resulting two lists then outputs them. right now I get no...
in the input there has to be a 1 after the x. I tried to make it more robust but my instructor told me not to bother lol
okay, I'm writing a function that takes two polynomials, adds them, then outputs the result. there are two things wrong with my program:
1) when one of the terms in the polynomial has an exponent...
the list stores a group of terms in a polynomial
struct term
{
int co; //coefficient of a term
int exp; //exponent of a term
term* link;
};
I attached the code because it's too long to post and I can't figure out what's wrong with what
basically I'm writing a program that inputs polynomials then lets you add and subtract them (format...
I can't do
list::list(const list& l1)
because I call get_head() in the definition
I guess I can post my code for + and the copy constructor. the class isn't really called list, I just used...
I just recently started getting a syntax error with my = operator and my copy constructor, but I don't even call the copy constructor in my program. here's the relevant code:
[code]...
ah, thank you very much. I knew it was something simple like that
okay, I'm writing a program that manipulates polynomials. the input looks like this: 2x3+3x2+4x+1
right now I'm working on the input and output functions. so far I've been able to successfully...
there's nothing in there that has anything to do with my problem except I learned that ios::trunc doesn't really delete, it just sets file length to 0. I think that explains why my other idea wasn't...
yeah it's a text file. I'm not very familiar with binary files
so back to my original point, how to I rewrite the file once I've inputted from it?
void Book::print(ostream& outs)
{
outs << title << endl << author << endl << copies << endl << price << endl;
}
void Library::print(ostream& outs)
{
for (int i = 0; i < size; i++)
...
there's a difference between what you can get away with and what's good programming style
okay, I've been trying this all day and I can't get it to work for the life of me. I'm trying to fill an object from a data file then possibly make changes to it and put it back.
the data file...
I've never found an occasion where inlining helped me noticeably
sweet, it's working now. thanks, I completely forgot to put ignore in there
I accidently left the resize function out, and I think my default constructor is fine, but it's up there now
if you need any more code let me know, I just don't want to post up more than you...
okay, I'm trying to input a bunch of data from a file then print it onto the screen. it's a little too complicated to explain so here's the code:
//first off, here's what the data file looks...
you need to add another condition to some of those statements
else if ((age >= 21) && (age < 30) && (children <= 0 )) {
cout<<"Getting ready to get a little action?\n";
} ...
okay, hopefully this'll be my last question for the day. I got the hard part of my program done
Basically I'm writing a program that manages a database for a library. it's a data file in this...
HA! success. I just got rid of the pointers and the big 3. I misread the directions my professor gave me. I'm not supposed to use dynamic memory until the second part of this program lol.