Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
looping with pointer
//g++ 5.4.0 #include <iostream> int main() { const int arrlen=4; char arr[arrlen]="vin"; int numvowels(0); for(char *ptr=arr;ptr<arr+arrlen;ptr++){ switch(*ptr){ case 'A': case 'a': case 'E': case 'e': case 'I': case 'i': case 'O': case 'o': case 'U': case 'u': numvowels++; } } std::cout<<arr<<" has "<< numvowels<<" vowels"; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
single_digit
multiply two numbers (previous)
c++ car racing game
namelookup
Equilateral triangle
Sum of digits of number
Splitwise Problem - 2
virtual function role
static property
Romberg Integration
Please log in to post a comment.