Can't find tutorial on how to make this program

Hi, I need to make a program using C++ in which

if ( String==Joe ) {

cout << "You can drink" << endl;

String is the name which is inputted into the console, I just don't know how to make such a code.

I really hope you guys understand what I'm trying to do here. Basically, if someone inputs their name and its Joe, then it should say "You can drink". I just don't know how to get it to do that.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <string> 
#include <cstdlib>

using namespace std;

int main(void)
{
  string input;
  cout << "Enter your name: ";
  cin >> input;
  if (input == "Joe")
    cout << "\nYou can drink.";
  system("pause");
  return EXIT_SUCCESS;
}
Not to be rude but you clearly dont even know the basics of c++ But i'd suggest learning here if you want to understand more - https://www.thenewboston.com/videos.php?cat=16
To add to @Rootkitee. New Boston was very helpful for me when I was learning, but take it with a pinch of salt. He uses some bad practices. Learn the conceps from him and do stuff with it yourself, find exercises online etc. And use google.
Yea thats true @TarolNeaj, also New Boston was very helpful for me too ^^
Thanks guys, and yeah @Rootkitee I don't know very much about C++, I'm learning the basics.



Thanks again!!
This is my other accout, so yeah I'm Harutyun
Topic archived. No new replies allowed.