小编Ash*_*wal的帖子

将 sda3 挂载到 /dev 是什么意思?

我在网上搜索了很多之后才问这个问题。

我在我的电脑上使用linux。它有一个有 3 个分区的磁盘。SDA1、SDA2、SDA3。sda3包含linux,sda2是swap,sda1是FAT。

我的问题是“sda3”是一个包含整个Linux的分区,我不明白将其安装在/dev/sda3上是什么意思?

/home、/usr、/var 一切都在 sda3 内,那么为什么我们说我们将 sda3 安装在 /dev 上,而 /dev 和所有其他文件系统都在 sda3 中?

linux mount file sda

1
推荐指数
1
解决办法
2万
查看次数

C++ 继承:避免调用基类的默认构造函数

在下面的代码中,我正在计算三角形的面积。一旦我声明了对象 tri1,宽度和高度就会被初始化两次。

第一:基类的默认构造函数被调用和值width = 10.9height = 8.0; 被自动分配给三角形。

然后:在三角形中构造宽度 = a; 和高度= b; 发生。

但是,我的问题是:有没有办法不从基类调用任何构造函数?

class polygon {
protected:
    float width, height;
public:
    polygon () {width = 10.9; height = 8.0;}
    void set_val (float a, float b) {width = a; height = b;}
    polygon (float a, float b) : width(a), height(b) {cout<<"I am the polygon"<<endl;}
};

class triangle: public polygon {
public:
    triangle (float a, float b) {cout<<"passed to polygon"<<endl; width = a; height = b;} …
Run Code Online (Sandbox Code Playgroud)

c++

1
推荐指数
1
解决办法
1690
查看次数

标签 统计

c++ ×1

file ×1

linux ×1

mount ×1

sda ×1