#include<bits/stdc++.h>
using namespace std;
{
// only run when we press ./a.out
// instruction 1
}
{
// only run when we press g++ main.cpp or gcc main.c
// instruction 2
}
int main() {
// other part of code
}
actually I want to read/write in a .txt file. when I run g++ main.cpp new .txt file should get created and when I run ./a.out " fout<<"my data"<<endl " should get execute.