3

There are a few errors in your code that mess up your output. printf("%c",toupper(n[0])); has a serious error. This works for Robert Thompson but not if there was a space before Robert. It would count the space as the initial and print it out, which will cause check50 to give errors. You want the first alphabetical letter, not the first character. There are ...


2

There are a couple of problems. The main one is that your code doesn't handle the case where the plain text and the key characters are not the same case. It assumes that if the plain text is lower case, then so is the key. Same for upper case. The three remaining problems are related - no error handling for command line inputs. The code should generate an ...


1

I suggest that you put a printf("%i",ci); instruction before you call your function here ci = original_index(ci); to check the value of your char variable 'ci'. With the value in mind, think what the output of the next function will be.


1

The reason why a string variable does not have brackets, is because it is not a string array. (It is a char array or a char pointer.) In fact, string is a new type, defined in the cs50 library. It will be explained in one of the following lectures (possibly Lecture 4). And to quote Cliff B: If this answers your question, please click on the check mark ...


1

The problem is how numbers are stored. A computer operates with a binary or base-2 number system. The real world operates in a base-10 system. The only fractional numbers that can be stored with perfect accuracy are those where the denominator is a power of 2, like 1/2, 1/4, 3/4, 5/8, etc. Any other fractional part of a floating point number, i.e., the ...


Only top voted, non community-wiki answers of a minimum length are eligible