Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

read string with space c

char name[30];
char temp;

printf("Enter age: ");
scanf("%d", &age);
printf("Enter name: ");
scanf("%c", &temp); // temp statement to clear buffer
scanf("%[^
]", name); // read until newline
Source by www.includehelp.com #
 
PREVIOUS NEXT
Tagged: #read #string #space
ADD COMMENT
Topic
Name
9+3 =