How to Begin with C++ (Frist Program Hello World)
The best way to begin is to think about what you want to achieve. In my case, I wanted to start with a simple program. When I thought about it, I realized that I’d always been curious about what a typical program might look like. So, I decided to write a hello world program. My goal was to write a basic program, compile it, and run it. At that point, I had accomplished all that I wanted to do in this first program. So I was ready to move on to more complicated projects.
/preprocessor directive #include iostream> Int main() /creates a new function
{
cout "Hello World"; Std::
}
- It is a preprocessor mandate to incorporate iostream>. The header documents are remembered for the source code. Iostream incorporates functions for both Out result and information streams. It contains the name of the included document.
- At the point when the source code is executed, the principal function is called. At the point when the program is executed, the fundamental capacity ought to be particular, as though it is the main primary capacity in the whole program.
- The keyword int in the main function indicates that it should always return a number of the integer type.
- Hello, World: it’s an exacting character string. A text will be printed. Text is generally put inside quote.
- Semicolon (;): It is the warning to the compiler that the assertion has been finished.