Sorry, I know I asked this question before, but I tried a different code, and the program crashes every time I execute.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "stdafx.h"
#include <iostream>
#include <string>
int main(){
std::string myname[4] {"My", "Name", "is", "Matilda"};
int i;
i = 0;
for (i = 0; i < myname[4].length(); i++){
if (myname[i] == "a" || myname[i] == "e" || my name[i] =="i" || myname[i] == "o" || myname[i] == "u"){
int a = 0;
a = a + 1;
std::cout <<a;
}
}
}
Please help.I'm totally new to programming, only started about 2 days ago, excuse me.