string.h和puts的问题
程序代码:
#include "stdafx.h" #include<stdio.h> #include<string.h> void a(char *, unsigned int); int main(void) { char b[] = "Hold on to your hats hackers"; puts(b); a(b, 7); puts(b); puts("Let s look at some more of the string"); puts(b+8); return 0; void a(char *string unsigned int size) { if(strlen(string) > size) *(string + size) = "\0"; }为什么不能运行?
PUTS怎么用?