• Hey! Register here to create your account, engage with the community, and talk about what is new!

Programming A Basic C++ Hello World Console Application

1pe

Forum adept
Overlord
Joined
Sep 23, 2020
Messages
121
Reaction score
25
Welcome to My First C++ Tutorial Today I will be show you the viewer how to make a basic C++ hello world console application!



C++:
#include <iostream> //The include statement is a way to incorporate different libraries into our code
//NOTE: WE MUST include iostream in our project

int main() { //Here we call the main function which we know will return an int because be called int before calling the function
//NOTE: ALL C++ applications must have a main function

std::cout << "Hello World" << std::endl; //This Writes Hello World to the Console
//std:: is the standard Library and cout and endl come from
//if we were to remove << std::endl, our next line would start on the same line as this
//Instead of using << std:endl; we can use \n for example "Hello World\n";

return 0; //When Returning 0 it tells our program that everything is running as it should
}


If anything is unclear leave a comment

I will try to make more of these regularly
 

FatFace_101

Well-known member
Joined
Sep 8, 2020
Messages
62
Reaction score
12
I am learning java. I WAS going to learn C++ but then i realised that it looks... well... worse than chinese
I have the exact opposite. Languages with garbage collection make me feel like something is deeply wrong and I need to free all this memory I am allocating.
 
Top Bottom