I use Dev 5 (Bloodshed). It is way better than Dev 4 which I started out on. I couldn't even get the debugger to work in Dev 4 (I don't think it was supposed to work). Anyways Dev 5 is awesome...
Type: Posts; User: warfang
I use Dev 5 (Bloodshed). It is way better than Dev 4 which I started out on. I couldn't even get the debugger to work in Dev 4 (I don't think it was supposed to work). Anyways Dev 5 is awesome...
It's a lot easier to understand when it's broken down and explained. Thanks all :)
Yeah that's one of the first ones I looked at.
I just don't get how it stats with
root->next = 0; //I guess it's just going to the next object in line?
and what's with the
Does anyone know of a really good Linked List tutorial for C++? I've been looking online and in my texts and most of it is confusing.
Ah, good info to know.
No, not true. They are needed and are very important for a programmer to use.
http://www.fredosaurus.com/notes-cpp/preprocessor/ifdef.html
You can also output what you want to know to a file.
You can't assign a pointer to another pointer. You can assign a pointer to a reference or a value but then you wouldn't be able to pass in a pointer. At least I think. Also, in your destructor...
it should work just like that except in your Book constructor your author needs to be a char pointer as well to match a.
You have to declare your createNewHold function before you main function. Either in your header file or right there where all your code is.
You're not calling createNewHold in your main function
Are you linking to the holding class correctly? Are you using all the files in a project? Make sure you have #include "class.h" and if it's not in a project you'll have to also add #include...
That is correct. Post some more of your code or the actual error so we can see what's going on.
EDIT: laserlight beat me to it
No, what you're asking can easily be found in tons of tutorials, books, and other threads. Just do a search.
You have create an istream object and use it to open up a file. Then you can use some of it's member functions like get to extract either lines or individual characters from the file. Then you can...
Oh, I did make it constant. Thanks!
That is what I did. I guess I didn't make it clear. I didn't change the function. The function always received a constant reference but I wasn't passing in a pointer. Now I am. Thanks for all...
I'm getting the feeling that a virtual function only allows you read data members and you're not able to alter or set them equal to anything in a virtual function. Is this true?
Wow once again I feel dumb. I fixed it. I was getting a memory reference because I wasn't passing in a pointer. Now I am and it works. Saweet!!!
Should I post more of my code or is that sufficient?
Code from the Derived class
void Book::print(ostream & out)const{
out << "BOOK: " << author << " " << '\"' << title << '\"' << " " << callNumber << endl;
...
This just allowed me to compile it. When I actually call the overloaded << operator it just returns the memory address the object is at. I'm trying to print out some of the data it holds :(.
For anyone who is interested I found an answer.
I just had to make my print functions const functions.
I'm still getting this error
`const Holding' as `this' argument of `virtual void Holding::print(std::ostream&)' discards qualifiers
I have it set up pretty much the same way as that link...
Well I got it to compile and then I checked it different ways and it's not working like it's supposed to. It's not even actually calling the function when I try to output it. I'll read that article...