Search:

Type: Posts; User: dougieb

Search: Search took 0.00 seconds.

  1. cool, thanks. I think I was mis-understanding...

    cool, thanks. I think I was mis-understanding the 'luckiness' of having the array pointer values always showing up as nil, when it's just as you say that early in a small program it's just by...
  2. so immediately after line 41 (and for any...

    so immediately after line 41 (and for any non-static variables), the correct thing to do is loop through the array setting each index value to nil ?
  3. Yes, I understand that. But my_array appears to...

    Yes, I understand that. But my_array appears to be initialised to nil in every array index position, rather than random/garbage data. How did that happen?
  4. static v automatic storage, initialising pointers to nil

    Hi,

    I am trying to understand how to manage arrays of pointers to structs. I built up some (verbose) simple code to build a struct containing an array of pointers to other structs. The main...
  5. For anyone else thinking of similar things, the...

    For anyone else thinking of similar things, the K&R C book (Ansi C edition) has a pretty good example (page 145 in my copy) to get started.

    This hashing function seems to produce a very equal...
  6. Tracking external user IDs in threaded tcp server.

    Hi,

    My scenario is similar to shopkeepers and customers. Shopkeepers open a long running tcp connection to the server, and have interactions with customers who have short lived tcp connections. ...
  7. Replies
    11
    Views
    1,450

    yep, that's it. makes sense when you understand...

    yep, that's it. makes sense when you understand it :-)

    thanks again..
  8. Replies
    11
    Views
    1,450

    good tutorial Andrew. Although it makes sense,...

    good tutorial Andrew. Although it makes sense, I'd never really considered that 'a pointer' is just variable that has it's own address as well. so &ptr is giving you a pointer to a pointer...
  9. Replies
    11
    Views
    1,450

    hmm.. "especially you should not simply copy...

    hmm.. "especially you should not simply copy pointers around... " is that what 'hostlist[0].name = hp->name' is doing ? is that copying the pointer in hp->name, rather than (as I wanted) copying...
  10. Replies
    11
    Views
    1,450

    Hi, thanks. yeah that extra ampersand was...

    Hi,

    thanks. yeah that extra ampersand was just left there while playing around with the first statement trying different options to print the address in hostlist[0].name.

    I get that...
  11. Replies
    11
    Views
    1,450

    pointers to pointers in struct

    hey,

    getting a bit confused with pointers, structs and pointers within structs. I'm trying to use gethostbyname to get resolve a hostname to an ip, which I will then store in the host struct. ...
  12. Replies
    9
    Views
    3,186

    just checked the http 1.1 spec, and the client...

    just checked the http 1.1 spec, and the client can request the connection state in the header:

    Connection: Keep-Alive

    Have a look at 10.9.1 in the http 1.1 spec.
  13. Replies
    9
    Views
    3,186

    I think you need to be looking at the KeepAlive...

    I think you need to be looking at the KeepAlive settings. I only know Apache (not IIS, BBC is a M$ shop right?), and you can switch this off entirely at the server end.

    I'm not not sure how...
  14. Replies
    52
    Views
    10,690

    that's great guys, makes sense. thanks,

    that's great guys, makes sense.

    thanks,
  15. Replies
    52
    Views
    10,690

    ok, so just to clarify (so I never need ask...

    ok, so just to clarify (so I never need ask again!).

    if the program is interrupted, the OS will free up any memory that has been allocated.

    if the program exits (finishes, crashes), the OS will...
  16. Replies
    52
    Views
    10,690

    and the OS does that because it is an interrupt?...

    and the OS does that because it is an interrupt?

    whereas if the program completes (and I don't free memory), the OS won't free it for me? thus leading to a memory leak?

    PS. actually thinking...
  17. Replies
    52
    Views
    10,690

    this is excellent. I just set out to find the...

    this is excellent. I just set out to find the difference between malloc and declaring variables (and why you don't free variables), and here is it after a short search. I didn't realise the...
Results 1 to 17 of 17