Search:

Type: Posts; User: wiiire

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    29
    Views
    4,734

    i's memory is allocated automatically on the...

    i's memory is allocated automatically on the stack and gets freed automatically when you leave whatever routine you're in - be it another function or main.

    Anything allocated memory with malloc()...
  2. Replies
    10
    Views
    5,002

    All the stuff below this : return 0; in...

    All the stuff below this :

    return 0;
    in your code needs to go into a new function called playCraps.

    You see, if you put code beneath your return statement, it's never going to get executed...
  3. Ahhh I see ! Thank you for that explaination... I...

    Ahhh I see ! Thank you for that explaination... I couldn't work out why it would be any different !

    I was hoping I could avoid making it static and passing a pointer, but I suppose not. At least I...
  4. A pointer to an object's function as a parameter

    hiiiiii!

    I'm going slightly insane here! This is the declaration for SDL thread creation:

    SDL_Thread *SDL_CreateThread( int (*fn)(void *), void *data );

    Based on this and the example I...
  5. Replies
    2
    Views
    1,801

    hmm, what was the full error? I believe in C,...

    hmm, what was the full error?

    I believe in C, if you're calling a function before you define it, you need to declare it first (your declaration for fcfs looks like it's in the middle of the...
  6. Replies
    10
    Views
    1,337

    What is that, exactly? I thought before it was...

    What is that, exactly? I thought before it was this :

    You just need to flush buffers to stop that... with flush...

    Could you be more precise?
  7. Yeah, I think that's the point :)

    Yeah, I think that's the point :)
  8. I find web definitions help make sense of this...

    I find web definitions help make sense of this stuff...

    Associate :- Make a logical or causal connection; "I cannot connect these two pieces of evidence in my mind"; "colligate these facts"; "I...
  9. Replies
    15
    Views
    2,739

    I haven't used Valgrind yet (only recently...

    I haven't used Valgrind yet (only recently switched to this craaaaaazy OS and not had the need for it so far), but is it no help in plugging the leaks you found?

    That would totally be my first...
  10. Replies
    10
    Views
    1,337

    If you use the flush manipulator on the stream,...

    If you use the flush manipulator on the stream, it will flush it to the file.



    cout << something << flush; // flush to cout's stream (default stdout)
    csis << something << flush; // flush...
  11. Replies
    15
    Views
    2,739

    You should find your swapfile usage drops to 0...

    You should find your swapfile usage drops to 0 (or close to it).

    Linux utilises all available RAM eventually and gives the appearance of not freeing it after processes have ended (really it's...
  12. Replies
    15
    Views
    2,739

    Ks add up to megabytes!! :) :)

    Ks add up to megabytes!! :) :)
  13. Replies
    1
    Views
    1,999

    Not precisely sure what you're doing, but.. ...

    Not precisely sure what you're doing, but..


    if(newTime > MAX_VALUE)
    newTime = newtime - MAX VALUE;

    Do you mean :


    if(newTime > MAX_VALUE)
  14. Replies
    7
    Views
    1,363

    Oh yeah sorry, that's C++ :/ (edit :- or...

    Oh yeah sorry, that's C++ :/

    (edit :- or really old, crappy C compilers like the one we have here!)
  15. Replies
    7
    Views
    1,363

    You're probably finding your code is erroring...

    You're probably finding your code is erroring here :

    if(!(marks = malloc(2*count*sizeof(int))))
    You need to cast the result to the pointer type.

    ie.


    marks = (int*) malloc(...)
  16. Thread: seg faulting

    by wiiire
    Replies
    14
    Views
    1,973

    At a first glance, it looks like you've coded...

    At a first glance, it looks like you've coded your find() routine to search down the list to the depth level equalling the length of the string passed :


    --len;
    if(len != 0)
    {
    ...
  17. I would say C expressions are state-less. In...

    I would say C expressions are state-less.

    In an imperative language, you could argue that an expression results in a value.

    Although the value of such expressions is relatively questionable...
  18. Thread: semaphore

    by wiiire
    Replies
    12
    Views
    3,876

    if(fork() == 0) fork makes me smile :D

    if(fork() == 0)
    fork makes me smile :D
  19. Thread: semaphore

    by wiiire
    Replies
    12
    Views
    3,876

    This is excellent for anyone trying to learn too...

    This is excellent for anyone trying to learn too :
    http://www.cs.mtu.edu/~shene/NSF-3/e-Book/index.html

    I've found its explainations better than most so far.
  20. Replies
    11
    Views
    4,073

    Its illustrious memory handling :D

    Its illustrious memory handling :D
  21. Replies
    1
    Views
    1,661

    I've decided to write a C library to handle my...

    I've decided to write a C library to handle my sockets.

    I have a few reasons for deciding this :

    1) boost, though undoubtedly cool looking, seems to provide additional abstraction which I...
  22. Replies
    11
    Views
    4,073

    Yeah gotta love C# for this particular ambiguity...

    Yeah gotta love C# for this particular ambiguity :rolleyes: :rolleyes:
  23. Replies
    2
    Views
    1,676

    What errors are you getting? A short list for...

    What errors are you getting?

    A short list for now :-

    * you have several inifinite loops :

    if(k=='1')
    {
    while(1)
    {
  24. Replies
    28
    Views
    4,653

    The whole point of being set work is that they...

    The whole point of being set work is that they learn from attempting to do it (as opposed to passively just listening to or reading rules).

    Kinda how most decent programmers learn ;)

    We had a...
  25. Replies
    8
    Views
    2,204

    for(int i=0; i=used; ++i) { which...

    for(int i=0; i=used; ++i)
    {

    which it never will unless used is 0...

    ;)
Results 1 to 25 of 46
Page 1 of 2 1 2