How to use memset() function to sets the first N bytes of a block of memory to the specified value in C

1 Answer

0 votes
#include <stdio.h>
#include <string.h>
 
int main(void)
{
    char s[] = "Building an example app";
  
	memset(s,'>',8);
	
	puts(s);
     
    return 0;
}


 
/* 
run:

>>>>>>>> an example app
 
*/

 



answered Feb 15, 2016 by avibootz
...