W
W
whatislov2020-04-20 23:12:38
C++ / C#
whatislov, 2020-04-20 23:12:38

Why does 'Hello, World!' compile even though other code was entered?

For some reason, another message is being compiled, what's the matter? 5e9e020e663aa862603385.jpeg
Actually, it's hardly a matter of the code, rather I'm crooked)

#include "std_lib_facilities.h"
int main()
{
  cout << "Введите ваше имя(и нажмите 'enter'):\n";
  string firts_name;
  cin >> firts_name;
  cout << "Привет, << first_name << "!\n";
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ronald McDonald, 2020-04-20
@whatislov

cout << "Hi, << first_name << "!\n";

I see an error. You also take a look.
Apparently, the compilation fails and the last working version of the program is launched.

S
scottparker, 2020-04-20
@scottparker

cout << "Привет, " << first_name << "\n";

E
exaw, 2020-04-30
@exaw

The Visual Studio C++ compiler needs some time to warm up, so the Kernighan-Ritchie bookmark can compile a certain number of times, this is your very Hello World.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question