main()
function.main()
function is the entry point of the C++main()
is the first to be executed#include
#include <iostream>
includes the iostream header, which provides objects like std::cout
for outputting text to the console.
Vaiable_type Variable_name = value;
int
--> represents whole numbers.float
|| double
--> represents real numbers.
float variable_name = 99.99f;
include <string>
should be added on top of the code.using namespace std;
after the #include <string>
std::string cariable_name = "This is a string."
#include <string> using namespace std; // method 1 int main() { string s1 = "Hello."; // method 1 std::string s2 = "Hello."; // method 2 return 0; }
bool variable_true = true; bool variable_false = false;
char variable_name = 'h';
const int max_value = 100;
max_value
can't be changed.