正在加载图片...
File: hello.h */ char hello( char =) File: hello. cpp *, # include< stdio. h>/)含函数 sprintf()的原型 # include< string. h>/包含函数 strlen(的原型 # include hello. h/包含函数 hello(的原型 char hello(char name)& char value- new char 9+ strlen(name) sprintf (value, Hello, %os. " name) return value:8 /* File: hello.h */ char *hello(char *); /* File: hello.cpp */ # include <stdio.h> //包含函数sprintf( )的原型 # include <string.h> //包含函数strlen( )的原型 # include “hello.h” //包含函数hello( )的原型 char *hello(char *name) { char *value = new char [9 + strlen(name)]; sprintf (value, "Hello, %s.", name); return value; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有