Generate A Random Character | C Programming Example

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

Комментарии • 16

  • @grimvian
    @grimvian 11 месяцев назад +3

    Fine video explaining the random facilities in C.
    In English, using the old ASCII representation is relatively easy, because the letters comes in a nice row. When using Danish, as I do, I could use the extended ASCII earlier, but now I had to face the dominating UTF8, which is compatible with ASCII, but using more bytes and the Danish letters does not come in a row.
    Maybe an idea to introduce UTF8 in a video, because as I understand, it's used almost everywhere...

  • @Learn_Master
    @Learn_Master 11 месяцев назад +2

    Big fan of your teaching style and your voice also

  • @fifaham
    @fifaham 10 месяцев назад

    Nice video, thanks Kevin.

  • @justcurious1940
    @justcurious1940 11 месяцев назад +1

    Can we take advantage of the fact that each time our program runs the operating system will allocate a random space for our variables in the memory, so we can use these random memory addresses to generate random numbers like this :
    char random(){
    long long random = (long long )&random;
    int value = (int) (random % 26 + 'A');
    return (char) value;
    }

  • @vinvivofikas9973
    @vinvivofikas9973 11 месяцев назад

    great content.
    Thank you!

  • @otaxhu
    @otaxhu 10 месяцев назад

    Please can you do a video like this but with cryptographically random integers? As an example in Go we have the crypto/rand package that uses under the hood urandom (native cryptographically number generator in Linux systems)

    • @PortfolioCourses
      @PortfolioCourses  10 месяцев назад +2

      One day I would like to do a video on crypotgraphically secure random number generation. It's a big topic though with different approaches, it's tough to cover, though maybe I can cover one reasonable approach...

  • @axn30158
    @axn30158 11 месяцев назад +1

    Do you think this method of generating random characters is good to create passwords?

    • @mansbjork5721
      @mansbjork5721 11 месяцев назад

      I think this might depend on whether this method generates random/pseudo-random numbers.
      To know this would inquire information about how time(), srand() and rand() operate.

    • @absentchronicler9063
      @absentchronicler9063 11 месяцев назад

      no it's not, using rand() for anything involving cryptography is not safe

    • @axn30158
      @axn30158 11 месяцев назад

      @@absentchronicler9063 how so

  • @muhammaddiymurodov9112
    @muhammaddiymurodov9112 11 месяцев назад +1

    Hello, I'm your long time subscriber and viewer and I noticed that you do not have any nested programming in c such as nested loops nested for loop/while loop, please teach also them

    • @ramakrishna4092
      @ramakrishna4092 11 месяцев назад +1

      Great idea
      Pls help us doing this sir .
      And one more question
      Why 1 is added when negative numbers shifting to right side
      What would be the reason . Will you pls help us doing a video on this Topic . Thanks you so much ❤.

  • @NikhilxD_m40a
    @NikhilxD_m40a 5 месяцев назад

    is it possible to do this with an array of charecters?

    • @PortfolioCourses
      @PortfolioCourses  5 месяцев назад

      Yes: ruclips.net/video/1W0hs55TLnQ/видео.html