Getting the first 10 characters of a string?

c, string

Solution

char myString[256]; // Input string
char dest[256];     // Destination string

strncpy(dest, myString, 10);
dest[10] = 0; // null terminate destination

Problem

I have not been able to find any information with a web-search. Where should I be looking?

Original source

Related problems