Untitled
unknown
plain_text
a year ago
445 B
5
Indexable
#include<iostream> using namespace std; class student{ public: int id; double gpa; void display() { cout<<id<<" "<<gpa<<endl; } student(int x,double y) { id = x; gpa = y; } student(){ cout<<"Default constructor"<<endl; } }; int main(){ student sonet(056,3.09),cabbo(52,3.56); sonet.display(); cabbo.display(); return 0; }
Editor is loading...
Leave a Comment