⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tri.h

📁 ARM 嵌入式系统软件开发 入门的最好例子
💻 H
字号:
/*                                                              */
/* tri.h - Header file for Triangle class                       */
/*                                                              */
/* Copyright (C) ARM Limited, 1999. All rights reserved.        */
/*                                                              */

#ifndef _TRI_H_ 
#define _TRI_H_

enum TriangleType { EQUILATERAL, ISOSCELES, SCALENE };

class Triangle {

public:

  Triangle();                 // default constructor
  TriangleType type() const;  // returns type of triangle
  double perimeter() const;   // returns perimeter of triangle
  void display() const;       // displays private attributes of triangle        
  ~Triangle();                // destructor, returns allocated memory

private:

  double x1, y1;              // coordinates of first vertex
  double x2, y2;              // coordinates of second vertex
  double x3, y3;              // coordinates of third vertex
  char*  title;               // attribute to show dynamic memory allocation 
};

#endif  // _TRI_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -