This is a C++ question
Write a program that asks the user to enter their name. First Name and Last Name are entered separately by the user. The program then tells the following:
• Which part (First name, or Last name), has more character, and how many more characters.
• Total number of vowels used in the complete name.
• Tells the user if the First Name and Second Name are same.
This is my assignment and we cannot use strings library. We are supposed to use the character arrays to go about doing this.
Up till now I haven’t been able to understand how can I figure out the number of indexes I use to store characters.
int main()
{
int count = 0;
cout << "Enter you first name: ";
char arr[10];
cin.getline(arr, 10);
for (int i = 0; i < 10; i++) {
if (arr[i] != ' ') {
count++;
}
else {
break;
}
}
int x= sizeof(arr) / sizeof(arr[10]);
cout << arr;
cout << endl << count<< endl<<x;
return 0;
}
but still I haven’t come around to a solution.