how to store a user input with spaces in c

Solutions on MaxInterview for how to store a user input with spaces in c by the best coders in the world

showing results for - "how to store a user input with spaces in c"
Alexander
21 Sep 2020
1#include <stdio.h>
2
3int main(){
4    char name[20];
5
6    printf("Enter a name : ");
7    scanf("%[^\n]%*c", &name);
8
9    printf("the name entered is: %s\n", name);
10
11return 0;
12}
Tom
05 Feb 2017
1#include <stdio.h>
2
3int main(){
4    char name[20];
5
6    printf("Enter a name : ");
7    fgets(name, 20, stdin); // fgets(variable_storing_to, accepted_input_size, stdin)
8
9    printf("the name entered is: %s\n", name);
10
11return 0;
queries leading to this page
how to scan string with spaces in cscan string with space in cscanf string with spaces chow to take string input in c with spacesinput string in cc input with spaceshow to read string input in c without 5cnstring input in c with spacehow to print string in c with spaceshow to read space separated string in chow to store a string with spaces in cc program to take space in a stringhow to take input string in cgetting string inputs in chow to include spaceds when inputting strings in cget string with space chow to read space in chow to take inputs in c with spacesc string with spacehow to take input as stringsstring with spaces as input chow to take input in c with whitespace in betwweenhow to read string with spaces in cspace in c stringtake input with spaces in cstdin string with spacehow to scan strings for spaces in cc how to read a string with spacesget c sring input with spaceshow to print string with spaces in c using scanfhow to include whitespace in string input cspace input in chow to accept space in string in cc input string with spacesc input long string with spaceshow to read a string with spaces in c 5cinput space cinput string from user in cread input with no spaces in chow to get space as input in cscanning strings with spaces in cc input function which can take whitespacec string input with spacestake an input with spaces in cread string with space cc scan line including whitespacec get input and immediately print to same spaceinput space containing stringsinput string in c with spacesinputting strings in caccept string c with spaceinput with spaces in ctake input string with space in ctake spaces as input in c stringc accept string input with spacehow to get string input in cread line with spaces in chow to take input int c with whitespace in betwweenhow to input string with spaces in c using scanfstring in c with spacetake input from user with spaces in cuser input in c with spacesc read input with spacesscanf c string with spaceshow to get two strings with spaces in ctake string input in c with spacesget string with space in chow to input string with spaces in ctaking in a string 25cread input with spaces in chow to take input string with spaces in cread variable accept spacesstring space in cread string with spaces with scanfusing space to take input scanfget string with spaces in cto take a string inputtake input of string with spaces in chow to read a string with spaces in chow to store a user input with spaces in chow to input string with whitespace characters in ctake string input with spaces in chow to get a string in c with spacehoqw to scan space in cget string in chow to accept a input with spaces in cinput a word with spaces in cc how to input a string with spaceshow to read in a string with spaces in ctake input in space chow to read in string with space in chow to input a string with spaces in cscanning complete string in chow to save a string in c with spaceshow to take integer input with spaces in chow to take the input with space in cstring gets space character cc read string with spaceshow to make input process spaces in caccept string in cget input with space in cinput string with spacein center input with space in cc name with spacehow to take input string values in c read string with spacesstring with spaces input in cinput string with spaces in chow to get a string user input in chow to take string as aan inputhow to store user input with spaces in ctaking string input with space in chow to take string input with spaces in cgetting a string with spaces from user cc take strin with spaceinputing string with spaces in chow to accept string from user in cinput space in ctake user input with space in chow to take string line input in cc scanner input with spaceshwo to read a string spacestring input in c with spaceshow to take input with spaces in cinput string c with spacestake input of string with space in chow to take input in c with spaceshow to store a user input with spaces in c