Ah thank you very much. :) I'll use nothrow as I've always liked the NULL pointer method. :)
Thanks mate,
--John.
Type: Posts; User: John.H
Ah thank you very much. :) I'll use nothrow as I've always liked the NULL pointer method. :)
Thanks mate,
--John.
Hey all,
Very simple question. Is it necessary to check the return value of the new operator when allocating memory, to ensure that memory was allocated correctly, like in C with malloc()? I've...
Oh dear, lol, I feel like such an idiot. Can't believe I didn't spot that. Not even class-related, it's a return-type lol. Ugh, been up all night studying. Thank you very much for pointing that...
Hey all,
I'm trying to compile some example source code from my MCSE coursework, which is supposed to demonstrate the use of operator overloading. Problem is, VC++ 6.0 SP5 dies. :( Here's the...
Thanks for the reply Jason. :) Oh and by the way, impressive resumé mate. Just had a quick look at your site. The 196 Palindrome record was very interesting. Hope all goes well. :)
--John.
Ok, thank you again. Sorry, I'm one of those people with Impulse Refresh Disoder. ;) I'll test that later on and see what happens. :)
Thanks mate,
--John
Thanks dude, that's what I thought. Heh, nice when things go to plan, eh? :)
John.
Hey all,
Just had a quick look through the board, and I think it's cleared it up, but I'm not 100% certain, so I wanted to ask. When working with classes, does the 'private' keyword mean that any...
Uh? Both text and binary file modes can be used with C as well as C++. "r" is deemed as opening a file for reading in text mode, whereas "rb" is the same, but in binary mode.
--John.
Edit:...
Ah, I see. So, you'd allocate the memory for the new node because obviously you don't know the size of it (plus the pointer needs some space allocated for the struct's contents anyway). So I think...
Thanks for the reply mate. :) Judging from your reply, I think my question is probably incorrect then. I don't actually know when to dynamically allocate memory. I can think of some obvious...
Hey all,
I'm getting myself in a bit of a mess I think. Let's say you've set up 2 pointers to structs, for a linked list. You've initialised them both to NULL, as in the following code fragment:...
Thanks Prelude. :)
John.
Hey all,
I'm doing an assignment, in which I'm reading the contents of a binary file, into a linked-list, which I then need to sort by customer code. At first, I was going to use a bubble-sort on...
The individual assignment worked just fine. Wasn't as bad as what I was thinking actually. Realised I'd defined a struct to hold the others, so I was able to just do this:
nnode->rec_type =...
Oops, almost forgot. :) tnode is the top node, and cnode is the current node. :) Just my odd naming convention lol.
John.
Firstly, thanks for replying. :)
Second:
for (cnode = tnode; cnode->next != NULL; cnode = cnode->next)
;
That was based on his code, not mine. I just included the extra bits as a demonstration as to what he was asking. :) Thanks for the heads up on kbhit() though. :)
John.
It won't work with just:
cout << password;
This is because you are reading in, and displaying, one character at a time using your for loops. You haven't used a null character to...
Hey all :)
I've got a problem adding a new node to a linked list. Firstly, here's the relevant code:
void addToList(Record *rptr)
{
Record *nnode;
Thanks dude, I'll check that out now. :) One thing though, those conditions wouldn't be compiler specific would they? Would partly defeat the point if they were.
Just wondering anyway, thanks...
Hey all. :)
I've just been scouting through the board to try and find a solution to what I thought would be a common problem, but 72 threads later and the only thing close to it, was detecting the...
Well I'll be damned. Thanks very much. I only really questioned it because I thought you couldn't copy one structure to another, like with an array.
Hmm, wonder where I got that idea from. ...
Hey all. :)
I've been given an exercise to code for my MCSE, which I've done, but the problem is, I don't quite understand why it works. I was given the following skeleton code, in which I have...
Thanks for replies folks. :) Got a lot to go on now. I'll have a read in a bit and see what the result is. :)
Thanks again,
John.