Skip to content
Snippets Groups Projects
Select Git revision
  • 0bb508933c25ed3128388c68fd9dd2c74afc109e
  • master default protected
  • undefined
3 results

sample_3.h

Blame
  • Forked from cp1_ws19 / cpp_introduction
    Source project has a limited visibility.
    sample_3.h 664 B
    #ifndef __SAMPLE_3_H__
    #define __SAMPLE_3_H__
    
    #include <string>
    
    namespace city {
    
    	// A custom type with a fixed number of permitted values
    	enum HouseColor {
    		red,
    		blue,
    		green,
    		white,
    		black
    	};
    
    	// A custom type with data fields
    	struct House {
    		// Our custom color
    		HouseColor color;
    		// A house number
    		uint32_t number;
    		// The name of the owner
    		std::string owner;
    	};
    
    	// A function to illustrate call by value
    	void copy_repaint(House torepaint);
    
    	// A function to illustrate call by referene
    	void copy_free_repaint(House &torepaint);
    
    	// A function to print out a description of the house
    	void describe_house(House &house);
    };
    
    #endif