Search:

Type: Posts; User: John.H

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,509

    Ah thank you very much. :) I'll use nothrow as...

    Ah thank you very much. :) I'll use nothrow as I've always liked the NULL pointer method. :)

    Thanks mate,

    --John.
  2. Replies
    2
    Views
    1,509

    Check the new operator's return value?

    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...
  3. Replies
    2
    Views
    667

    Oh dear, lol, I feel like such an idiot. Can't...

    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...
  4. Replies
    2
    Views
    667

    Class Compilation Problem

    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...
  5. Thanks for the reply Jason. :) Oh and by 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.
  6. Ok, thank you again. Sorry, I'm one of those...

    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
  7. Thanks dude, that's what I thought. Heh, nice...

    Thanks dude, that's what I thought. Heh, nice when things go to plan, eh? :)

    John.
  8. Confirming the meaning of the private/protected keywords

    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...
  9. Replies
    24
    Views
    3,204

    Uh? Both text and binary file modes can be used...

    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:...
  10. Replies
    5
    Views
    2,231

    Ah, I see. So, you'd allocate the memory for the...

    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...
  11. Replies
    5
    Views
    2,231

    Thanks for the reply mate. :) Judging from your...

    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...
  12. Replies
    5
    Views
    2,231

    When and when not to use malloc()?

    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:...
  13. Replies
    2
    Views
    993

    Thanks Prelude. :) John.

    Thanks Prelude. :)

    John.
  14. Replies
    2
    Views
    993

    Insertion sort question

    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...
  15. Replies
    5
    Views
    1,103

    The individual assignment worked just fine. ...

    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 =...
  16. Replies
    5
    Views
    1,103

    Oops, almost forgot. :) tnode is the top node,...

    Oops, almost forgot. :) tnode is the top node, and cnode is the current node. :) Just my odd naming convention lol.

    John.
  17. Replies
    5
    Views
    1,103

    Firstly, thanks for replying. :) Second: ...

    Firstly, thanks for replying. :)

    Second:



    for (cnode = tnode; cnode->next != NULL; cnode = cnode->next)
    ;
  18. Thread: printf/cout

    by John.H
    Replies
    4
    Views
    1,212

    That was based on his code, not mine. I just...

    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.
  19. Thread: printf/cout

    by John.H
    Replies
    4
    Views
    1,212

    It won't work with just: cout

    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...
  20. Replies
    5
    Views
    1,103

    Linked list question

    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;
  21. Replies
    3
    Views
    1,114

    Thanks dude, I'll check that out now. :) One...

    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...
  22. Replies
    3
    Views
    1,114

    Detecting the OS

    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...
  23. Well I'll be damned. Thanks very much. I only...

    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. ...
  24. Alphabetical string sort (got it working, but not sure why)

    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...
  25. Thanks for replies folks. :) Got a lot to go on...

    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.
Results 1 to 25 of 55
Page 1 of 3 1 2 3