+ 1

gets function (C++)

any know why below code could not return the value? #include<iostream> #include<cstdio> using namespace std; int main() { char m[90]; gets(m); cout<<m; return 0; }

18th Aug 2017, 9:37 AM
Rohman D
Rohman D - avatar
3 Answers
+ 20
gets is creating problem why don't u use cin.getline() function for inputting string
18th Aug 2017, 9:43 AM
Mansi Dagla
Mansi Dagla - avatar
+ 6
Did you call main()?
18th Aug 2017, 9:40 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
@vengat what main? sorry i'm newbie..
21st Aug 2017, 2:22 AM
Rohman D
Rohman D - avatar