#include<stdio.h>
int main()
{
char happy[]="good";
char result[3]="\0";
snprintf(result,3,"%s",happy);
printf("%s\n",result);
}
Result
go
Reference:
#include<stdio.h>
int main()
{
char happy[]="good";
char result[3]="\0";
snprintf(result,3,"%s",happy);
printf("%s\n",result);
}
Result
go
Reference:
0 意見:
張貼留言