Anyone please say
#include <iostream> #include <string> using namespace std; class student{ protected: string name, gender, grade; int age; public: void get() { cout << "Enter the name of The student : "; getline (cin, name); cout << "Enter the age of the student : "; cin >> age; cout <<"Enter the gender of The student : "; cin >> gender; cout << "Enter the grade of the student : "; cin >> grade; } }; class general public student{ protected: string stream; int mark; public: void get1() { cout << "Enter the stream of the student : "; getline (cin, stream); cout<<"Enter the mark of the student : "; cin >> mark; } void print (){ cout << endl; cout << "Name" << name <<endl; cout << "age: << age <<endl; cout << "gender: " << gender << endl; cout << "stream: " << stream << endl; cout << "mark: " <<mark << endl; cout << "grade: " << grade << endl; }; int main() general obj; obj.get(); obj.get1(); obj.print(); return 0; }
Use a pasting website.
Do you not have a proper editor and compiler configured? That looks like an online editor, by default it'll pass nothing as input
Delete this non sense I've found out what's with that
no it's something to do with getline's delim
ohh, i didn't even look at their code
Oh is this affect any issues in my office ? They monitor everything
Bro if you know means say Don't criticise please i will try to improve
It's not a crit just delete this text wall
Ok I can't copy paste so used Google lens
I don't know, pasting service is a way to share code online, you could be under radar as you're sharing stuff online. Also should you be using your workplace for this?
Forgotten \n
Don't necropost
Use this when input a string: getline(cin >> ws, str);
No bro I am found the mistake and changes Ws is missing
Do i have to warn people for necroposting?
What is mean by necrosposting brother
replying to old messages
Обсуждают сегодня