Mega Code Archive

 
Categories / C / Code Snippets
 

Read a certain length of string

#include <stdio.h> int main(void) { int j; char str[100], str2[100]; scanf("%20s", str); printf("%s", str ); return 0; }