strncpy copies 'n' bytes from one string to another.
Library:   string.h
Prototype: char strncpy(char s1, const char *s2, size_t n);
Syntax:	   size_t n;
	   char string1[20]="red dwarf";
	   char string2[20]=";
           strncpy(string2, string1, 4);
 example
program.
 example
program.
 An
alternative method using 'sprintf'...
 An
alternative method using 'sprintf'...
| Top | Master Index | Keywords | Functions |