Back to index

salome-med  6.5.0
Functions
MEDMEM_Exception.cxx File Reference
#include "MEDMEM_Utilities.hxx"
#include "MEDMEM_Exception.hxx"
#include <math.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

char * duplicate (const char *const str)

Function Documentation

char * duplicate ( const char *const  str)

Function used to duplicate char *

Definition at line 45 of file MEDMEM_Exception.cxx.

{
        ASSERT_MED(str!=NULL) ;
        const size_t length = strlen( str ) ;
        ASSERT_MED(length>0) ;
        char *new_str = new char[ 1+length ] ;
        ASSERT_MED(new_str) ;
        strcpy( new_str , str ) ;
        return new_str ;
}