title: C++ typedef and return types: how to get the compiler to recognize the return type created with typedef?
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class A {
      typedef int myInt;
      int k;
  public:
      A(int i) : k(i) {}
      myInt getK();
  };
  
  myInt A::getK() { return k; }
  
  int main (int argc, char * const argv[]) {
      A a(5);
      cout &lt;&lt; a.getK() &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>myInt is not recognized by the compiler as an 'int' in this line:</p>
  
  <pre><code>myInt A::getK() { return k; }
  </code></pre>
  
  <p>How can I get the compiler to recognize myInt as int?</p>