Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - strncpy http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                                 strncpy

   Usage
   include <string.h>
   char *strncpy(char *string1,const char *string2, size_t n);

   Description
   Copies  the first n characters of string2 into string1. If string2  is
   longer  than string1, the result will not be null '\0' terminated.  If
   string2  is less than n characters, string1 will be padded to  n  with
   null characters.

   Example
   #include <stdio.h>
   #include <string.h>
   char *string2 = " Add this string";
   char buffer[50];
   main()
   {
        printf("\nstrncpy Example[%s]\n",  strncpy(buffer,string2,10));
   }

   Return Value
   It returns string1.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson