Search:

Type: Posts; User: the pooper

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    34
    Views
    4,166

    I am grateful to people who help. I am grateful...

    I am grateful to people who help. I am grateful to cwr, lemnisca, TactX and pianorain. As I said "Whatever floats your boat" is not helpful. And since then all you've done is mix very little...
  2. Replies
    34
    Views
    4,166

    It's a good idea, and I had also thought it might...

    It's a good idea, and I had also thought it might work, but when I tried it each run of the program would still end up mallocing the same block of memory. And so the pointer it returns and,...
  3. Replies
    34
    Views
    4,166

    Sorry, but you made it sound like you did not get...

    Sorry, but you made it sound like you did not get that impression. Your attempt to clarify the article, however useful it may be to others, was posted as a reply to _me_. This made it sound like you...
  4. Replies
    34
    Views
    4,166

    No, I'm not worried about cryptographic strength...

    No, I'm not worried about cryptographic strength randomness. But there may be two or more instances of this program running at any given moment and I don't want such instances to produce identical...
  5. Replies
    34
    Views
    4,166

    Yes, such a case *is* undesirable, which is why I...

    Yes, such a case *is* undesirable, which is why I stated I don't like their srand suggestion.

    Hence the question mark in my post. I'm not saying "use the pid", I'm saying "can I use the pid?". Is...
  6. Replies
    34
    Views
    4,166

    I still don't much like their srand suggestion....

    I still don't much like their srand suggestion. Can I get the process ID? I personally would include that in the seed.
  7. Replies
    34
    Views
    4,166

    Ok, it appears their final recommended solution...

    Ok, it appears their final recommended solution is effectively the same as what I had come up with, so that's good.
  8. Replies
    8
    Views
    1,570

    I see. I made the mistake of assuming that a byte...

    I see. I made the mistake of assuming that a byte is always 8 bits.
  9. Replies
    34
    Views
    4,166

    rand and srand

    Since calling srand in one library will affect the result of rand in all other libraries is it considered good practice to leave that responsibility to the main program? They would have a better idea...
  10. Replies
    8
    Views
    1,570

    I'm not arguing that this is true, but I'm...

    I'm not arguing that this is true, but I'm curious if this causes problems. Aren't there systems that natively use 2 bytes for a character? If so wouldn't this cause problems when mallocing...
  11. Replies
    14
    Views
    2,283

    I was making a distinction between the two types,...

    I was making a distinction between the two types, which is pretty much the opposite of believing them to be the same. That quotes does not apply at all to what I said.

    So ultimately you cannot...
  12. Replies
    14
    Views
    2,283

    Nothing in that article contradicts what I said,...

    Nothing in that article contradicts what I said, nor is any part of my post specific to Win32 (barring the results of the example I ran on my personal computer). The terms 32-bit and 64-bit reflect...
  13. Replies
    14
    Views
    2,283

    Why a long? Seems to me just a regular unsigned...

    Why a long? Seems to me just a regular unsigned int is the correct data size, since 32-bit computers have 2^32 addressable memory locations and 64-bit computers have 2^64 addressable memory...
  14. Replies
    3
    Views
    1,586

    Perfect, thanks. If anyone's interested this was...

    Perfect, thanks. If anyone's interested this was for creating a behind-the-scenes method of solving memory leak issues. Dangling pointers are handled as well. Below is an example of a fictional...
  15. Replies
    3
    Views
    1,586

    Exit Function

    Is it possible to define one or more functions to execute just before a program terminates?
  16. Replies
    13
    Views
    1,591

    C89...

    C89 (Technically only a draft, but identical to the final release as far as I know. If anyone knows where C89 is freely available, spread the word.)

    and C99 (This one's the real thing.)
  17. Replies
    13
    Views
    1,591

    I can't provide a practical example either. But...

    I can't provide a practical example either. But the point is that it is allowed to happen. Programming would be so much easier if we allowed ourselves to ignore errors that were uncommon. But robust...
  18. Replies
    13
    Views
    1,591

    But the standard says that argv[0] will be a...

    But the standard says that argv[0] will be a pointer to a string only if argc is greater than 0. So if argc is 0 then argv[0] would be NULL, and the other requirements that are dependant on argc...
  19. Replies
    3
    Views
    1,128

    Unless I'm mistaken, you're also reading your...

    Unless I'm mistaken, you're also reading your value into unallocated memory, unless this isn't your actual code. You've declared x[0] to be a pointer to a struct, but the actual struct for x to point...
  20. Replies
    19
    Views
    36,304

    I hope everybody here realizes that there is a...

    I hope everybody here realizes that there is a formula for calculating Fibonacci numbers.
    (pow(1 + sqrt(5), n) - pow(1 - sqrt(5), n)) / (sqrt(5) * pow(2, n))This means that fib(10) can be calculated...
  21. Replies
    11
    Views
    3,040

    I think I will provide these additional checks...

    I think I will provide these additional checks through assertions. That way they can still be disabled in the final program.I remember now where I got the style of _FOO_H_. I was looking at the...
  22. Replies
    11
    Views
    3,040

    Is there a general style then for pre-processed...

    Is there a general style then for pre-processed constants in library code?The responsibility for this I decided to leave to the user. If they push some fixed number of items then they should know...
  23. Replies
    11
    Views
    3,040

    Finished Stack

    I've learned a lot thanks to people on this board. Below is an implementation of an array stack that I wrote and rewrote as I learned new or better concepts. I hope people will take a moment to...
  24. Replies
    5
    Views
    1,168

    Also, chris1985, I've found that with...

    Also, chris1985, I've found that with optimizations small functions such as this are usually inlined in the final program anyway.

    If you're using gcc then the -S switch should output assembly...
  25. Thread: Namespaces

    by the pooper
    Replies
    8
    Views
    1,948

    Thanks anonytmouse. You've been a big help.

    Thanks anonytmouse. You've been a big help.
Results 1 to 25 of 43
Page 1 of 2 1 2