string key = "YTNSHKVEFXRBAUQZCLWDMIPGJO";
for (int i = 0; i < 25; i++)
{
key[i] = toupper(key[i]);
}
printf("%s", key);
I am using the cs50 header file for the string datatype. I wrote some code related to encrypting as a problem set in the cs50 course. The code compiled but didn't completely execute. The exit status came as False.
I also tried printing some stuff in the later half of the code I had written but it didn't print. I step by step commented the rest of the code to check what was creating the problem, and it came out be the above lines. These lines of code compile but and even the executable runs properly, but there is no output. For ex.
string key = "YTNSHKVEFXRBAUQZCLWDMIPGJO";
for (int i = 0; i < 25; i++)
{
key[i] = toupper(key[i]);
}
printf("%s", key);
printf("Hello");
If I ran this, even the bottom printf hello wouldn't print.