the  same question
i have changed code style

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

it has only one mistake

    1>c:\users\david\documents\visual studio 2010\projects\measure\measure.cpp(5): error C2447: '{' : missing function header (old-style formal list?)


the  same question
===

i have changed code style

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

it has only one mistake

    1>c:\users\david\documents\visual studio 2010\projects\measure\measure.cpp(5): error C2447: '{' : missing function header (old-style formal list?)

