BASIC STRING Operation in pointer method in C language strcpy,strncpy strcat strlen

Syntax of command used in pointer character
Size_t strlen(const char*s)
It returns the number of characters in ‘S’ not counting the terminating null character. Character indicate the variable as pointer
Strcpy();
char *strcpy(char* dest, const char* src);
It copies source to destination string , stopping after the terminating null character has been moved
Strncpy();
char *strncpy(char *dest,const char *src,size_t maxlen);
It copies max len character form source to destination ,truncating or null padding destination.
Strcat();
char *strcat(char *dest,const char *src)
It appends a copy of source to the end of destination. The length of resulting string is strlen(dest)+strlen(src).

Post a Comment

0 Comments