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 :: printf with bool 
C :: C float division 
C :: c code to python code converter online 
C :: Numeri in ordine crescente C 
C :: dvlprroshan 
C :: find power of a number in c 
C :: how to convert string to integer in c 
C :: malloc int array c 
C :: how to shutdown system c++ 
C :: #![feature]` may not be used on the // stable release channel 
C :: how to read character from a string in c 
C :: remove first character from string c 
C :: if statement c short form 
C :: c/c++ type format 
C :: %d in c 
C :: typedef pointer 
C :: sum average min max in c array 
C :: initialize array in c with 0 
C :: read a document in c getting name from console 
C :: c int to char 
C :: vowel and consonant C 
C :: how to reset all values of 2d vector to 0 
C :: arrays in c 
C :: DrawText() raylib 
C :: unsigned char c programming 
C :: recursive in c 
C :: unpack and repack deb package 
C :: c structure with pointer 
C :: redis service 
C :: majuscule en c 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =