Standard C String Character

memset

Syntax:

#include <string.h>
void *memset( void *buffer, int ch, size_t count );

Description:
The function memset() copies ch into the first count characters of buffer, and returns buffer. memset() is useful for intializing a section of memory to some value.

#include<stdio.h>
#include <string.h>
 
int main()            //Main Function 
{
 char *str1 = "happy";
 char *str2;
  printf("str1: %s\n",str1);
 
  str2 = memset( str1, '-', 2);
 
  printf("str2: %s\n",str2);
 
  str2 = memset(str2,'\0',sizeof(str2)); //set all the values of string to zero
 
  printf("str2: %s\n",str2);
 
 return 0;
}

atoi

strchr

strncat

strcat

strtok

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.