Caesar Cipher C Program

Sdílet
Vložit
  • čas přidán 28. 12. 2016
  • Caesar cipher c program for lower case letters.
    See video on Viginere Cipher:
    czcams.com/users/edit?o=U&vide...
    Code:
    github.com/randerson112358/C-...
    Please Subscribe !
    ►Become a Patreot: patreon.com/randerson112358
    ►Website: everythingcomputerscience.com/
    ►Support this channel on Patreon: / randerson112358
    ►Support this channel get a ceasar cipher decoder ring: www.amazon.com/gp/product/B00...

Komentáře • 19

  • @kennielarsen940
    @kennielarsen940 Před 4 lety

    Hello, thanks for the solution. I don't know if comments are still answered, but how come you subtract 97 and then add them again after? I don't clearly get the idea, as removing those would still equal to the same result? At least in the tests I've done so far :-)

  • @cybro5123
    @cybro5123 Před 2 lety +1

    thank you broh , really nice logic ..but u may wanna add a condition for the spaces that are going to be typed , if the message is going to contain a sentence with words

  • @jamesdempsey9907
    @jamesdempsey9907 Před 6 lety +2

    Great video and very helpful am stuck and not sure why.
    I enter my message and the encrypted message comes back as : The encrpted message is: , cypher, cypher, cypher, cypher, cypher
    Any help would be much appreciated.

  • @oliverbolton9518
    @oliverbolton9518 Před 7 lety

    I tried this and my output just cycles through the characters for example "hello" came out as "ellox" any tips?

  • @panasheterencekujinga8160

    why do you use fgets instead of scanf? is there a difference

    • @ComputerSciencecompsci112358
      @ComputerSciencecompsci112358  Před 7 lety +9

      There is a difference, I am using it to be able to read in a line of text such as "hello world notice the space".
      You can not scan in the whole string using scanf just the "hello" portion will be read.
      But if you just want to scan in one string like "hi" then you can use the scanf function and will have to change the caesarCipher function to the following:
      Note: All I did is delete the '-1' from the while loop.
      void caesarCipher(char* plainText, int key){
      int i=0;
      int cypherValue;
      char cypher;
      while( plainText[i] != '\0' && strlen(plainText) > i){
      cypherValue = ((int)plainText[i] -97 + key) % 26 + 97;
      cypher = (char)(cypherValue);
      printf("%c", cypher);
      i++;
      }
      printf("
      ");
      }
      Thanks for watching and the comment!

  • @BVK_LMZ
    @BVK_LMZ Před 3 lety +1

    thanks

  • @erickung393
    @erickung393 Před 2 lety

    May I ask why we need to subtract 1 from strlen(plaintext)? Why need minus 1? I didn't get it😭😭 can someone explain to me please

    • @ys5603
      @ys5603 Před 2 lety

      by default indexing of char pointer or array begin from 0 index that's why we are subtracting it with -1 to balance the length with the char array. It's similar to loop when we start indexing from 0 than we put only less than operator (

  • @Pioneer4
    @Pioneer4 Před 2 lety

    My output is infinite times running why?

  • @TheDramenable
    @TheDramenable Před 6 lety +2

    Que buen video wey la neta te rifas un chingo, a huevo necesitaba esto para entregar un proyecto y tu explicas bien vergas, dices paso a paso todo y eso esta bien chingon we la neta te dejo un pinche likesote a la verga eres la verga jalate a la verga compa fierro pariente cero miedo si o no compa la neta al chile pelon si wey

  • @dharmang
    @dharmang Před 6 lety +1

    can u plzz zoom in a bit cause am watching on a 5.5 inch and still cant see btw lol 😂

  • @Duqtur_mohammad_Omar
    @Duqtur_mohammad_Omar Před rokem +1

    thnnx bro for this useful video bt it would be better using a screenrecoder coz i couldnot see clearly......

  • @unboxmodz8584
    @unboxmodz8584 Před 6 lety

    damn how many years have you been reading about c?

  • @mehmetuguryetis6709
    @mehmetuguryetis6709 Před 4 lety

    Sir ı have a assigment just like you did. may you help me if you write your e-mail, I can send you pdf file

  • @vincentarasaratnam4742

    Its not very much clear in your video, video capacity too, small