Ich habe einige Kompilier-Fehler und weiß nicht warum:
- Code: Alles auswählen
char codeword[100];
char text[100];
char lockedMessage[100];
char unlockedMessage[100];
int codewordLength;
int textLength;
//! if text is longer than codeword, then repeat codeword until it fits the whole text
[color=red]if (codewordLength < textLength)[/color]
{
int j = 0;
for (int i = codewordLength; i < textLength; i++)
{
if (j = codewordLength-1)
{
j = 0;
}
[color=red]codeword[i] = codeword[j];[/color]
j++;
}
}
[...]
static void main(void)
{
//! receive codeword from user and save it into codeword[]
printf("Please enter a codeword: ");
scanf(%s , codeword);
codewordLength = strlen(codeword);
//! receive text from user and save it into text[]
printf("Thank you");
printf("Now enter your message please: "\n);
scanf(%s , text);
textLength = strlen(text);
[...]
Die rot markierten sind als Fehler markiert
