Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "sort.h"
  3.  
  4. //#define _DEBUG_
  5. #define _DEBUG2_
  6.  
  7.  
  8. typedef void ( *pF ) ( int *, int );
  9.  
  10. clock_t T;
  11.  
  12. void InitTab( int*, int );
  13. void PrintTab( int*, int );
  14. void Test( pF* pSortFun, const char* pMethodNames[], int N, int* pPat, int nSize );
  15.  
  16. int main( int argc, char* argv[] )
  17. {
  18.    
  19.     if( argc !=2 )
  20.     {
  21.       printf( "attention: error");
  22.      return 1;
  23.     }
  24.    
  25.     int nSize = atoi( argv[ 1 ] );
  26.  
  27. #ifdef _DEBUG_
  28.     printf ( "Generating Tab of %d elements...\n\n", nSize );
  29. #endif
  30.    
  31.     int* pPat = ( int* )malloc( nSize * sizeof( int ) );
  32.     if( !pPat )
  33.     {
  34.         printf( "error: pPat not allocated" );
  35.         return 1;
  36.     }
  37.  
  38.     memset( pPat, 0, nSize * sizeof( int ) );
  39.  
  40.     InitTab( pPat, nSize ); //initiation Tab with random numbers
  41.    
  42.     #ifdef _DEBUG2_
  43.     PrintTab( pPat, nSize );
  44.     #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement