Skip to content

Abensett/17.CPP-Module-05

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

17.CPP-Module-05

  • Nested classes = classes imbriquées
  • Exceptions

Nested classes

class cat
{
  class paw
}
cat::paw instance;

Exceptions :

class GradeTooHighException : public std::exception				
{
	public:
				virtual const char *what() const throw()
        {
            return ("Bureaucrat::exception : Grade is too high");
	}
};

try
{
 	 if (grade > max)
          	throw GradeTooHighException() ;
}
catch (std::exception &e)
{
   	  cout << e.what() << endl;
}

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published