Click here to Skip to main content
15,948,339 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here i want to scan two strings(multiple) but it just scan only the first one and does not ask for second.it printsout the output without scanning the second string why?

What I have tried:

scanf("%[^\n]s",s1);
scanf("%[^\n]s",s2);
printf("%s\n",s1);

printf("%s\n",s2);

OUTPUT
enter two strings
sndn sdnson
sndn sdnson
*
Posted
Updated 11-Mar-17 6:34am

1 solution

Possibly some clues here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900