Welcome To C++: Curly Brackets
Welcome To C++: Curly Brackets
C++ is a popular cross-platform language that can be used to create high-performance applications -
operating systems, browsers, video-games, art applications and so on.
Q: C++ is a:
A) Movie making program
B) Client-side scripting language
C) General purpose programming language
#include <iostream>
using namespace std;
int main()
{
return 0;
}
You will learn what each of the statements does in the upcomming lessons.
For now, remember that the entry point of every C++ program is the main() function, irrespective of
what the program does.
Curly brackets {} indicate the beginning and end of a function, which can also be called the function’s
body. The information inside the brackets indicates what the function does when executed.
#include <iostream>
using namespace std;
int main()
{
cout << “Hello world”;
return 0;
}
cout is the stream object used to perform output on the standard output device which is usually the
display screen.
cout is used in combination with the insertion operator <<.
Ex: Write one line code to output “Hello, world!” on the screen.
{
cout << “This “ << “is “ << “awesome!”;
return 0;
}
In C++, the semicolon is used to terminate a statement. Each statement must end with a semicolon. It
indicated the end of one logical expression.
Headers
C++ offers various headers, each of which contains information needed for programs to work
properly.
We have already seen the standard <iostream> header on our first C++ program:
#include <iostream>
using namespace std;
int main()