When I started learning C ++, I downloaded IDE Dev C++ with built-in gcc and g++ . I first wrote programs and did not notice, but then I noticed that when I write any code for example:

 #include <iostream> int main(){ using namespace std; float a = 2.34E+22f; float b = a + 1.0f; cout << "a = " << a << endl; cout << "b - a = " << b - a << endl; system("PAUSE"); return 0; } 

Yes, and any other and click Compile and run the program is executed and when the program ends and main returns 0 then its window closes and the file is created gmon.out Did not know who to ask the system administrators or programmers, but when he was convinced that the file is not a compiler / IDE and the program itself after its execution decided to ask the programmers:

  1. Why is this file created ( gmon.out )?
  2. What is it created for?
  3. What makes it create and how to cancel the program’s creation of this file ?

PS I noticed that the file always weighs exactly 123KB and does not contain the beginning of the MZђ type MZђ as in the case of programs, and it contains the beginning of the type:

 Ђ @ `дC й ydx < дю" к @ 


 Ђ` @ °дC 8й ydx U дю" 4 @ 

and then the bits that the notebook considers as spaces / tabulation and if two programs output the same text, then the file they contain is the same ... It seems to me that everything that cout brought out is written there ...

  • @ Kotik_hokhet_kushat you can explain yourself, google issue in English and if you write what gmon.out is, then it finds something wrong ... - Rules
  • 2
    compile with the debugging option -pg, typically. % man gcc% man gprof you can delete it if you have no use for it. And what incomprehensible? - Gorets
  • Is it possible to cancel the file creation? And it is not the compiler that creates it, but the program itself that baffles in general ... - Rules
  • 2
    @avp, it's not about English, but about the author’s desire to see in Google itself what it is, the information is not hidden, not confusing, and by its request all the first links fit in Google, at least in Russian, at least in English, yes and google translater would help him understand the meaning .. - Gorets
  • one
    @Gorets, are you eager to teach everyone how to live correctly? Or see only questions that you like? I wonder who and why will need a forum of questions , if they are answered - go learn . - avp

2 answers 2

Why was it necessary to argue when it was immediately possible to clearly answer the question posed.

gmon.out is a code profiling file. Simply put, it contains information for analyzing the program. This file is opened via gprof (GNU profiller). If you do not want this file to be created with each compilation, then you need to specify in the Dev cpp settings: "Project" -> "Project options" -> "Compiler" tab -> "Code profiling" and set "no"

    In short, gmon.out is a file with information about how the program was executed.

    Read more: Accelerating Code with the GNU Profiler

    @Gorets, is it really unclear from the @Rules comment that he cannot read English? Although, they say that if you stare at a text in an unfamiliar language for a long time, then gradually its meaning begins to reach you.

    • > he cannot read in English Ignorance of the laws does not release, however. There are dictionaries and automatic translators. An interesting situation turns out, OPU is curious what kind of file it is, but not interesting enough to devote 2 hours (exactly how much has passed between the question and the answer) of its precious time. - karmadro4
    • one
      @ karmadro4, I can only repeat my comment Are you burning with the desire to teach everyone how to live correctly? Or see only questions that you like? I wonder who and why will need a forum of questions, if they are answered - go learn. - avp pm
    • I fully agree with you @avp, @ karmadro4 considers himself "the smartest" and asks himself "How to extract Russian words from a string on JS?" XD - Rules
    • one
      @avp, you are lowering the bar this way. > go and learn. In the community of programmers, this is always and everywhere implied. Your own vision accepts with open arms those who do not wish to learn and generally do something on their own. Such forums are full and one more is not very necessary. @Rules, look in the mirror . - karmadro4
    • one
      @ karmadro4, regarding the questions, I consider this: do not like it, pass by . My attitude to the wrong answers is the opposite. Only I must be sure that the author of the answer is mistaken, not me. HashCode transformations neither into an elite snobbish Habr, nor into a talentless Q & A I do not want. - avp pm