Skip to content

2024/04/20/for-the-love-of-god-only-call-srand-once #1

@utterances-bot

Description

@utterances-bot

For the love of god, only call srand() once | MyNameIsTrez’ blog

One of the most common C mistakes I’ve seen is to call srand(time(NULL)); right before using rand() to generate a random number:

https://mynameistrez.github.io/2024/04/20/for-the-love-of-god-only-call-srand-once.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions