void upper(char in[30]); //Uppercase letters function
{
char in[30];
int a, out = 0;
printf("Enter a sentence, please. \n");
gets(in);
for (a = 0; in[a] != '\0'; a++)
{
if ( in[a] >= 65 && in[a] <= 90 )
out++;
}
printf("\n\tNumber of uppercase letters in your sentence: %d", out);
getche();
return;
}
void menu(char in[30]) //Menu function
{
char in[30], out;
int a;
do
{
printf("Enter a sentence with a maximum of 30 characters please.");
gets(in);
printf("Select a function, please.\n1=repeat_functıon\n2=number_of_uppercase_functıon\n3=average_number_of_letters_per_word\n4=functıon_most_repeated_letter\n");
scanf("%d",&a);
switch (c)
{
case 1:
rpt(char in[30]);
break;
case 2:
case 3:
avg(char in[30]);
case 4:
}
printf("\nPress e or E to exit. ");
scanf("%c", &out);
while (out != 'e' && out !='E');
}
};
This is my code, and it gives me the following errors:
1> c:\....22_proj2.cpp(33) : error C2601: 'avg' : local function definitions are illegal
1> c:\....22_proj2.cpp(8): this line contains a '{' which has not yet been matched
1> c:\....22_proj2.cpp(75) : error C2601: 'menu' : local function definitions are illegal
1> c:\....22_proj2\18050127622_proj2.cpp(8): this line contains a '{' which has not yet been matched
1> c:\....22_proj2\18050127622_proj2.cpp(105) : fatal error C1075: end of file found before the left brace '{' at 'c:\....22_proj2.cpp(8)' was matched