title: A few questions about const methods in my class
body: <p>I'm new to using C++ to write enterprise software at my company and the usage of const in member functions has been quite confusing to me. For example, I have the following method:</p>
  
  <p><code>string DAC::impulse_find(int i)</code></p>
  
  <p>There will be no modification of the variable i. My code compiles perfectly when I use these three variants of adding const to the above method:</p>
  
  <p><code>const string DAC::impulse_find(const int i) const</code></p>
  
  <p><code>const string const DAC::impulse_find(const int i) const</code></p>
  
  <p><code>string const DAC::impulse_find(const int i) const</code></p>
  
  <p>So what exactly is the difference between these three? I looked at some past answers and say "It applies to whatever is to the left" but that is still confusing. Does it apply to anything, such as the name of the class as well?</p>