Search
 
SCRIPT & CODE EXAMPLE
 

C

reading string with spaces in c

scanf ("%[^
]%*c", name);
Comment

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
Comment

PREVIOUS NEXT
Code Example
C :: downgrade chrome to previous stable version in linux 
C :: matrix multiplication in c 
C :: c language time() function 
C :: how to scanf two dimensional array in c 
C :: c for loop 
C :: bash while loop n times 
C :: set value of boolean in c 
C :: pyramid using c 
C :: c code to add two numbers 
C :: how to get input in 2d array in c 
C :: try and catch in rust 
C :: The fscanf and fprintf functions 
C :: how to reset all values of 2d vector to 0 
C :: why there is return 0 used in c 
C :: fgets c 
C :: how to malloc for matrix in c 
C :: selection sort c 
C :: print float number completely in C language 
C :: print an int c 
C :: how to merge 2 bytes into an integer 
C :: C fscanf ignore commas 
C :: create arrya of chars malloc 
C :: array of strings c 
C :: hash function in c 
C :: how to read and write to fiel n c 
C :: linux_reboot_magic2 
C :: solutionadda 
C :: change base int in c 
C :: scranton inhabitants 
C :: C Program to Maintain an Inventory of items in Online Store 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =