#include<stdio.h>
#include<assert.h>
void *my_memset(void *buffer,char c,int count){
assert(buffer);
char *temp;
int count_temp=count;
temp=(char*)buffer;
while(count>=1){
temp[--count]=c;
}
temp[count_temp]='\0';
return buffer;
}
void main(){
char buffer[5];
int i=0;
char c='a';
int count=4;
my_memset(buffer,c,4);
for(i=0;i<4;i++){
printf("%c",buffer[i]);
}
}
#include<assert.h>
void *my_memset(void *buffer,char c,int count){
assert(buffer);
char *temp;
int count_temp=count;
temp=(char*)buffer;
while(count>=1){
temp[--count]=c;
}
temp[count_temp]='\0';
return buffer;
}
void main(){
char buffer[5];
int i=0;
char c='a';
int count=4;
my_memset(buffer,c,4);
for(i=0;i<4;i++){
printf("%c",buffer[i]);
}
}