- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
IT, Programming, & Web Development › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2: [Arrays] – Functions, Variable and Scope, Debugging, Arrays, and Command Line Arguments › Assigning keys to plaintext with ASCII
for (int i = 0; i < countstring; i++) //starts with first character of plaintext till the end
{
for (int c = 0; c < 25; c++)
{
if (s == argv[1])
{
s == int argv[1][65 + c];
}
}
}
printf("ciphertext: %s", s);
Seeking help what is wrong with s == int argv[1][65 + c];
Reply
assignment operation =
is different than equality condition ==
Query
s == int argv[1][65 + c];
Do you mean, it should be:
s = int argv[1][65 + c];
instead of:
s == int argv[1][65 + c];
Reply
aren’t you trying to “assign” the value of argv[][]
to s[]
?
Query
Yes.
Reply
then use assignment operator[learn_press_profile]