我想在C中,將打印一個字符串作爲參數的函數。這在C中甚至可能嗎?C編程。如何使方法來打印一個字符串
我在我的頭文件中有這樣的東西,但字符串不是一個有效的標識符。我知道C中沒有字符串,但string.h類是什麼?
#include <string.h>
#ifndef _NEWMAIN_H
#define _NEWMAIN_H
#ifdef __cplusplus
extern "C" {
#endif
void print (string message){ //this is where i need help
printf("%s", message);
}
#ifdef __cplusplus
}
#endif
#endif /* _NEWMAIN_H */
謝謝大家。我學到了一些新東西。 – user69514 2009-09-12 02:56:03