+ 2

Why we create array while using char data type in c?

24th May 2019, 4:39 AM
Nidhi pandey
Nidhi pandey - avatar
16 Answers
+ 4
I don't think so, because the last time I try using pointer it doesn't work, maybe expert may have another means, let me call in a guru ~ swim ~
24th May 2019, 4:48 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
yeah, char arr[10]=0; scanf("%s", arr); or gets(arr);
24th May 2019, 4:45 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
~ swim ~ thats was just a typo error
24th May 2019, 6:08 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
Thank u Asterisk 😀
24th May 2019, 6:22 AM
Nidhi pandey
Nidhi pandey - avatar
+ 3
Ty swim
24th May 2019, 6:24 AM
Nidhi pandey
Nidhi pandey - avatar
+ 2
maybe to create a string or to create lots of character array to choose from for an option
24th May 2019, 4:40 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
Bt i wanted to know is there any other way for taking string as an input
24th May 2019, 4:47 AM
Nidhi pandey
Nidhi pandey - avatar
+ 2
What is swim
24th May 2019, 4:50 AM
Nidhi pandey
Nidhi pandey - avatar
+ 1
Yeah I know to create or to take string as an input.But is there any way to take string as an input in c?
24th May 2019, 4:42 AM
Nidhi pandey
Nidhi pandey - avatar
+ 1
Ty
24th May 2019, 4:43 AM
Nidhi pandey
Nidhi pandey - avatar
+ 1
Tysm Airee n Asterisk
24th May 2019, 4:43 AM
Nidhi pandey
Nidhi pandey - avatar
+ 1
Yeah i tried this approach.
24th May 2019, 4:46 AM
Nidhi pandey
Nidhi pandey - avatar
0
That's a replacement for strings. In Javascript, you can treat strings like arrays. In C, they are literally arrays of characters
24th May 2019, 4:42 AM
Airree
Airree - avatar
0
No, there are no strings in C
24th May 2019, 4:43 AM
Airree
Airree - avatar