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

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -