Teaching Newbies since 2014

kauress

  • Home
  • Javascript ❤
    • JavaScript
    • Node.js
  • WebDev Tuts
  • screencasts
  • Resources
  • VR & AR
  • Contact
  • Github
  • Twitter
  • YouTube
  • RSS
  • C++
You are here: Home / C++ / main function in C++

January 1, 2020 by: Kauress

main function in C++

The main function runs automatically when a C++ program is compiled and executed. Let’s assume the program is written inside a file called main.cpp. “.cpp” is the file extension for all C++ files just like HTML files have a “.html” extension.
int main{
}
Compile:
g++ main.cpp
Execute:
./a.out
VR Dev w/ me: Part 1
Hello World in C++

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2021 ·Kauress