I am trying to check that the substitution key contains all the alphabets but am getting error: expression result unused for this line of code: s, l ++; Can anyone help, this is my code as of now:
#include <cs50.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main(int argc, string argv[])
{
int n = strlen(argv[1]);
int s = 97, l = 65, count = 0;
if (argc != 2) //check 1 argument given only
{
printf("Usage: ./substitution key\n");
return 1;
}
else if (n != 26) //check if key contains exactly 26 characters
{
printf("Usage: ./substitution key\n");
return 1;
}
else //check key contains each alphabet exactly once
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (argv[1][i] == s || argv[1][i] == l)
{
count ++;
}
}
s, l ++;
}
}
if (count == 26)
{
printf("OKAY!");
}
}
s
andl
then uses++, l++