measure texts code from programming pearls
<p>I have this code from programming pearls</p>

<pre><code>#include &lt;iostream&gt;
//#include &lt;string&gt;
using namespace std;
template &lt;class T&gt;
void measure(char *text)
{
    cout&lt;&lt;"measure"&lt;&lt;text&lt;&lt;"\t";
    cout&lt;&lt;sizeof(t)&lt;&lt;"\n";
}
#define MEASURE(T,text){
cout&lt;&lt;text&lt;&lt;"\t";
 cout&lt;&lt;sizeof(T)&lt;&lt;"\t";
 int lastp=0;
  for (int i=0;i&lt;11;i++){
      T *p=new T;
      int thisp=(int)p;
       if (lastp!=0)
            cout&lt;&lt;" "&lt;&lt;thisp-lastp;
       lastp=thisp;
  }
  cout&lt;&lt;"n":
  }

int main(){

     return 0;
}
</code></pre>

<p>but there are some mistakes</p>

<pre><code>1&gt;------ Build started: Project: new_practises, Configuration: Debug Win32 ------
1&gt;  practises.cpp
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(11): error C2143: syntax error : missing ';' before '&lt;&lt;'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(12): error C2143: syntax error : missing ';' before '&lt;&lt;'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(12): error C2086: 'int cout' : redefinition
1&gt;          c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(11) : see declaration of 'cout'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2059: syntax error : 'for'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2143: syntax error : missing ')' before ';'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2143: syntax error : missing ';' before '&lt;'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2143: syntax error : missing ';' before '++'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2086: 'int i' : redefinition
1&gt;          c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14) : see declaration of 'i'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2059: syntax error : ')'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2143: syntax error : missing ';' before '{'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(14): error C2447: '{' : missing function header (old-style formal list?)
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(21): error C2143: syntax error : missing ';' before '&lt;&lt;'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(21): error C2086: 'int cout' : redefinition
1&gt;          c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(11) : see declaration of 'cout'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(22): error C2059: syntax error : '}'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(22): error C2143: syntax error : missing ';' before '}'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(22): error C2059: syntax error : '}'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(24): error C2143: syntax error : missing ';' before '{'
1&gt;c:\users\david\documents\visual studio 2010\projects\new_practises\practises.cpp(24): error C2447: '{' : missing function header (old-style formal list?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>

<p>What do I need to fix?</p>
