I am currently new to both this board and to C programming. What I am attempting to do, is to compare a character to another one.
This is done by:
I try merrily to compile this, and I get some warnings:
char vowels = "aeiouyŠ°ň";
int isVowel(char c)
for(i = 0; i < strlen(vowels); i++) if(strcmp(tolower(c), vowels[i]) == 0) return 1;
// Several other irrelevant lines of code
// I have some lines of a song saved in char *lines[NO_LINES]
// where NO_LINES is defined to 4.
// The call of isVowel from the function rem:
for(i = 0; i < NO_LINES; i++)
for(j = 0; j < strlen(lines[i]); j++)
if(isVowel((char)lines[i][j]) == 0) printf("%c", lines[i][j]);
And when I try to run the program, I get:
$ cc o1.c
o1.c: In function 'isVowel':
o1.c:17: warning: passing argument 1 of 'strcmp' makes pointer from integer without a cast
o1.c:17: warning: passing argument 2 of 'strcmp' makes pointer from integer without a cast
remove is an argument to start rem(), and lines is filled with 4 lines from before rem()'s call. I have tried to debug this, and it is the strcmp(tolower(c), vowels[i]) call that causes the problem. I have ensured that I have included all necessary headers, but I cannot see why I get this bus error. Thus I would be more than happy if I could get some help from you.
$ ./a.out remove tresmaa.txt
Thanks in advance and best regards,