Вот код
int main(int argc, string argv[]);
{
bool yes = false; //Will determine any value that is not equal to zero is false
int l = 0
int length = 0;
string text = ""
//User input
do
{
if(argc!=2) //Argc is too when it is run with one command line argument
{
printf("Invalid\n");
return 1; //main entry function
}
else //converts string to an interger
{
l=atoi(argv[1]);// converts the frist command line
yes = true;
}
} while (!yes); //if yes is true
text = get_string(); //Gets string
length = strlen(text); //Gets length of string inputed
for (int i = 0; i < length; i++)
{
if(isalpha(text[i]))//check if letters are in alphabet
{
if (islower(text[i])) //lower case letters
{
printf("%c", ((((text[i] - 97)+l)%26)+97)); //Translates from 0 to 26 so l + 26
}
else
{
printf("%c", ((((text [i] - 65)+l)%26)+65)); //Translates from 0 to 26 so l + 26
}
}
else
{
printf("%c", text[i]);
}
}
printf("\n");
}
Ошибка в том, что я не знаю, что не так с моими скобками.
caesar.c: 14: 1:ошибка: ожидаемый идентификатор или '(' {^ 1 ошибка сгенерирована. make: *** [caesar] Ошибка 1