title: How to create a module in the main class in c++?
body: <p>I've got a great problem, that may be a newbie one.My problem is that I get an error that the method was not created in this scope, but it really it is.</p>
  
  <pre><code>int main() { //beggining main
    int n;
    int m;
    int result =0;
    cout &lt;&lt; "Dime m en (m sobre n)" &lt;&lt; endl;
    cin &gt;&gt; m;
    cout &lt;&lt; "Dime n:" &lt;&lt; endl;
    cin &gt;&gt; n; 
    result = calculate(m,n);
    cout &lt;&lt; result &lt;&lt; endl;
    return 0;
  } //finish main
  
  int calculate(int m, int n){ //begin calculate
    return m+n;
  } //finish calculate
  </code></pre>
  
  <p>when I build the project, I get ‘calculate’ was not declared in this scope in the result = calculate(m,n); line ;</p>
  
  <p>It may be a silly thing, but why do I get this error? Thanks a lot</p>