bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

pgrm_003.cpp (555B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* class - object */
      8 
      9 #include<iostream>
     10 using namespace std;
     11 
     12 class person {
     13     public:
     14         int age;
     15         string name;
     16 
     17         void setName(string n) {
     18             name = n;
     19         }
     20 
     21         void setAge(int a) {
     22             age = a;
     23         }
     24 };
     25 
     26 int main() {
     27     person p;
     28     p.setName("Amit Dutta");
     29     p.setAge(19);
     30     cout << "Name: " << p.name << endl;
     31     cout << "Age: " << p.age;
     32     return 0;
     33 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror