Defines the entry point for the console application. - C++ Language Basics

C++ examples for Language Basics:Hello World

Description

Defines the entry point for the console application.

Demo Code

#include <iostream> 
#include <string> 
  
using namespace std; 
  
int main(int argc, char *argv [])
{ 
        cout << "What is your name?" << endl; 
  
        string name {}; /*from w ww . j av  a 2s  .  c  o m*/
        cin >> name; 
  
        cout << "You said your name is: " << name << endl; 
  
        return 0; 
}

Result


Related Tutorials