c - Getting the first 10 characters of a string? -


i have not been able find information web-search. should looking?

char mystring[256]; char dest[256]  strncpy(dest, mystring,10); dest[10] = 0; //null terminate destination 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -