memset()用法實例
#include <stdio.h>
#include <stdlib.h>
char a[100] ;
int main()
{
memset(a,'\0',sizeof(a));
printf("%s\n",a);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
char a[100] ;
int main()
{
memset(a,"\0",sizeof(a));
printf("%s\n",a);
return 0;
}
memcpy()用法實例
#include <stdio.h>
#include <stdlib.h>
char a[100] ;
#define position 5
int main()
{
memset(a,'1',sizeof(a));
printf("%s\n",a);
char b[100] = "https://jason-cl.blogspot.com/";
memcpy(a+position,b,4);
printf("%s\n",a);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
char a[100] ;
#define position 5
int main()
{
memset(a,'1',sizeof(a));
printf("%s\n",a);
char b[100] = "https://jason-cl.blogspot.com/";
memcpy(position+a,b,5);
printf("%s\n",a);
return 0;
}
沒有留言:
張貼留言