0
plz fix the bug
using namespace std; #include<iostream> class Student{ public: int id; string name; void put_details(int i,string n){ id=i; name=n; } void get_details(){ cout<<"id:"<<id; cout<<"\nname:"<<name; } }; int main{ Student s1; int s_id; string s_name; cout<<"Enter id of student: "; cin>>s_id; cout<<"Enter name of student: "; cin>>s_name; s1.put_details(s_id,s_name); s1.get_details(); }
2 Answers
+ 3
Save code and share link for quick responses..
You should add first lines as header files. then next code or logic..
So swap first 2 lines..
+ 1
#include <iostream>
using namespace std;