In C, is there string data type? If no, how to store a string value? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In C, is there string data type? If no, how to store a string value?

5th Aug 2020, 12:58 PM
lasya katari
lasya katari - avatar
1 Answer
+ 1
it has an access specifier “%s” which can be used to directly print and read strings. let's see with example 👇 👇    #include<stdio.h>    int main() {        // declaring string     char str[50];            // reading string     scanf("%s",str);            // print string     printf("%s",str);        return 0; }
5th Aug 2020, 1:02 PM
Sâñtôsh
Sâñtôsh - avatar