memset: copies ch into the first count characters of *buf : memset « string.h « C / ANSI-C






memset: copies ch into the first count characters of *buf


    


//Declaration:  void *memset(void *buf, int ch, size_t count); 
//Return:       returns buf. 

  



#include <string.h>
#include <stdio.h>

int main(void){
  char buf[100];
  memset(buf, '\0', 100);
  memset(buf, 'X', 10);
  printf(buf);
}

         
/*
XXXXXXXXXX
*/ 
           
       








Related examples in the same category