Home > Back-end >  How to scan name and surname separated with space with scanf function in C without using loop and sa
How to scan name and surname separated with space with scanf function in C without using loop and sa

Time:01-29

I tried using %[] but VSC immediately paint the % red and report an error.

enter image description here

CodePudding user response:

You can use scanf() to read a string with embedded spaces this way:

char fullname[100];

if (scanf("           
  •  Tags:  
  • Related