Answers for "c++ in console"

C++
3

how to output to console c++

/*there are 2 ways of doing it.*/
#include <iostream> // including the main thing needed
int main(){
  std::cout << "Text here.";
  //you could put using namespace std; so you just have to do
  cout << "Text Here.";
  //this isnt reccomended though.
  printf("hi");
  //is also an option.
  return 0;
}
Posted by: Guest on May-24-2020
0

compilling c++ and c by console

//mingw compiler
//write in cmd for c++
g++ (path of the cpp file) -o (path of the cpp file but delete the ".cpp" and replace it by exe or the type that you want) )
Posted by: Guest on December-02-2021

Browse Popular Code Answers by Language