Warning when using gets() funtion in C++
Asked by
pepperblue
I wrote this program for test C++.
*******
#include<iostream>
#include<string>
using namespace std;
class stud {
private:
int rno;
char name[20];
public:
void getdet() {
cout<<"Enter your roll number: ";
cin>>rno;
cout<<"\nEnter your name: ";
gets(name);
}
void putdet() {
cout<<"Roll number: "<<rno;
cout<<"\nName: "<<name;
}
};
int main() {
//system(clean);
stud s;
s.getdet();
s.putdet();
}
*******
But it gave a warning: i.cpp:(
What does it mean?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu gcc-4.2 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Federico Vera
- Solved:
- Last query:
- Last reply:
To post a message you must log in.