⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 str_dup.c

📁 MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程环境.
💻 C
字号:
/*   supply my own strdup just in case   Ed Karrels   Argonne National Laboratory*//* don't call str_dup -- use STRDUP */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "str_dup.h"#ifdef NEEDS_STDLIB_PROTOTYPES#include "protofix.h"#endifchar *str_dup( str, line, file )char *str;int line;char *file;{  char *p;  p = (char *)malloc( strlen( str )+1 );  if (!p) {    fprintf( stderr,	     "Failed to allocate %d bytes of memory in line %d, file %s\n",	     (int)(strlen( str )+1), line, file );    return 0;  } else {    strcpy( p, str );    return p;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -