13 lines
306 B
C
13 lines
306 B
C
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
char buffer[15];
|
||
|
|
||
|
printf( "%s\n", strncpy( buffer, "abcdefg", 10 ) );
|
||
|
printf( "%s\n", strncpy( buffer, "1234567", 6 ) );
|
||
|
printf( "%s\n", strncpy( buffer, "abcdefg", 3 ) );
|
||
|
printf( "%s\n", strncpy( buffer, "*******", 0 ) );
|
||
|
}
|