I need to write a program that converts vowels to "*" can you give me some tips about it.
I need to write a program that converts vowels to "*" can you give me some tips about it.
What are you holding the characters in and are you familiar with pointers?
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
I am familiar with pointers and I am holding characters with array
So one way would be to set up another character array containg the vowels. Outer loop (i=0; i<strlen(string); i++) inner loop (j=0; j<5; j++) and test string[i] against vowels[j] if there is a match string[i] = '*'.
This is assuming you have 5 vowels in your second array.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
there are functions in <cstring> for dealing with c style strings.
check out std::strpbrk(your_string,"aeiouAEIOU") and how that can help you.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
thank you very much
what about standard 'if' statements?
Code:for(i=0;i<strlen(string);i++) if(string[i]=='A'|| string[i]=='a'|| string[i]=='E'|| string[i]=='e'|| string[i]=='I'|| string[i]=='i'|| string[i]=='O'|| string[i]=='o'|| string[i]=='U'|| string[i]=='u') string[i]='*';
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
it takes up more room (coding wise) and its (i think) slower