i am new to c, i am trying to make a simple code in which i replace the vowels of an input with the * character... i am having trouble with the array (i am mainly familiar with python only using c now.)
#include <stdio.h>
char* main() {
int c;
char* vowels[] = {'a', 'e', 'i', 'o', 'u'};
while( 1 ) { // means: true
c = getchar();
if(c == EOF) break;
if(c = vowels) putchar('*');
else putchar(c);
}
}
i keep receiving the same error message: novowels.c:5:41: note: (near initialization for ‘vowels[4]’) novowels.c:10:12: warning: assignment makes integer from pointer without a cast [-Wint-conversion] if(c = vowels) putchar('*'); ^
.... please help, i can't quite figure out how do complete this program of replacing vowels with *
trueandstdbool.hthen? - too honest for this site_Bool. - fuztrueis anint, not_Bool. It is just standard C. And can you recify calling the unsigned integer type_Bool"weird"? - too honest for this site_Boolhas different conversion rules from any other type. It also has a more restricted range thancharwhich is something that breaks with the conventions of C (i.e.charbeing the most narrow type). - fuz