This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> /// std::cout; std::endl; | |
| int main () | |
| { | |
| int i = 0; | |
| std::cin >> i; /// inserting some data into the stream and returns a state return by input operator(insertion operetor) | |
| if (std::cin.rdstate() == std::cin.badbit) /// checks the following conditions | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| class Account | |
| { | |
| public: | |
| Account () = default; | |
| Account (std::string n, int id, double m) : | |
| name (n) , id_no (id), money (m) { } | |
| void modify_prime (double); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| class Debug { | |
| public: | |
| constexpr Debug (bool a, bool b, bool c): | |
| hw (a), io (b), other (c) { } | |
| constexpr Debug() : Debug(false, false, false) { } | |
| constexpr Debug (bool aa) : Debug (false , false ,false) { } | |
| constexpr Debug (bool aaa, bool bb) : Debug (false, false, false) { } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| #include "exercise.h" | |
| int main() | |
| { | |
| Book b1("lippman", "c++primer", "blahblah", "2211"); | |
| display(b1); | |
| b1.modify_author("kryssel").modify_title("blah blah").modify_date("nov 28 1998").modify_isbn("2220-222"); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| class Person; | |
| class option | |
| { | |
| public: | |
| typedef int number; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| class B; /// forward declaration to know the types in function members in Class A | |
| class A | |
| { | |
| public: | |
| void modify (B &,const int &); | |
| int &display (B &); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| #include <string> | |
| #include "Sample_c.h" | |
| Sample_c::Sample_c (std::string dat) : | |
| data_member1 (dat) { } | |
| Sample_c &Sample_c::f1 (char c1) | |
| { | |
| this->data_member1 = c1; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include "Person.h" | |
| #include <iostream> | |
| #include <string> | |
| /// implementation section | |
| Person::Person (std::string n, std::string a) : | |
| name (n), address (a) {} | |
| const Person &Person::display () const | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <iostream> | |
| #include <string> | |
| #include "Person.h" | |
| Person::Person (std::string n, std::string a, int ag, int cn) | |
| { | |
| std::cout << "the object is created " << std::endl; | |
| name = n; | |
| address = a; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #define PERSON_H | |
| #ifdef PERSON_H | |
| #include <iostream> | |
| #include <string> | |
| class Person | |
| { | |
| public: /// public specifier only accessible through all program |