Guest User

Untitled

a guest
Jan 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include "..\stdafx.h"
  2.  
  3. File::File( int pType, char *pPath, char *pFilename, long pSize )
  4. {
  5.     this->type = (int*)malloc( sizeof(int) );
  6.     this->path = (char*)malloc( 512 );
  7.     this->filename = (char*)malloc( 512 );
  8.     this->size = (long*)malloc( sizeof(long) );
  9.  
  10.     this->type = (int*)pType;
  11.     strcpy( this->path, pPath );
  12.     strcpy( this->filename, pFilename );
  13.     this->size = (long*)pSize;
  14. }
  15.  
  16. File::~File()
  17. {
  18.     free( this->type );
  19.     free( this->path );
  20.     free( this->filename );
  21.     free( this->size );
  22.  
  23.     this->type = NULL;
  24.     this->path = NULL;
  25.     this->filename = NULL;
  26.     this->size = NULL;
  27. }
Add Comment
Please, Sign In to add comment