0

why am i getting error?

#include <stdio.h> #include<string.h> int main() { string a; return 0; }

1st Jun 2018, 3:36 PM
Bahubali
Bahubali - avatar
4 Answers
+ 6
string is not a supported data type in C programming . In C programming, string is a character of array. For declaring a string variable, you should use this syntax : char string_name [size]; example : char a [30]; OR char a [];
1st Jun 2018, 3:55 PM
Nova
Nova - avatar
+ 2
everything seems to be fine except for an unused variable warning
1st Jun 2018, 3:48 PM
‎ ‏‏‎Anonymous Guy
+ 2
1st Jun 2018, 4:07 PM
Bahubali
Bahubali - avatar
+ 1
or just change stdio.h to iostream
1st Jun 2018, 4:00 PM
‎ ‏‏‎Anonymous Guy