I'm new to this site but have been taking a programming class for about a semester now. I just had a question as to why my program is skipping all the cases, goes to default, and closes immediately without stopping or doing anything. It's probably just a small thing but I've been sitting here forever and can't see it. Here's the code. Thanks for the help:
//Name Game
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
using namespace std;
int main(void)
{
char name, zzz;
cout << "Hello, and welcome to the start of a fantastic new adventure. \nI'm your guide for the day: Sebastian. \nMay I ask what your name is?\n";
cin >> name;
switch (name)
{
case 'alex':
case 'Alex':
cout << "What an absolutely beautiful name. It sends chills down my spine just thinking about it. \nYou're one lucky girl.";
cout << "\nI've heard from my friend that you are as beautiful as your name suggests.";
break;
case 'Ryan':
case 'ryan':
cout << "Please stop using this project. What are you even doing here?";
break;
default:
cout << "That's a nice name. You should keep it for as long as you can.";
cin >> zzz;
return (0);
}
return 0;
}