- 博客(1)
- 资源 (12)
- 收藏
- 关注
原创 C++浅拷贝的另一种实现方式以及CONST指针
虽然C++的浅拷贝编译器已经默认帮我们实现了,但是作为一个技术人员应该要具备有最基本的“黑客精神”,说到C++浅拷贝的实现,大家第一反应就是通过拷贝构造函数实现成员变量的直接赋值。也就是如下的代码: class A { public: A() { arrayA = new int [size];//内存分配 for( size_t i = 0;i<si
2016-12-11 21:38:48 947
2013-2014华南理工大学操作系统课程设计(完整源代码和详细文档)
Requirements
1. Simulate a Unix file system on your Windows Platform
2. Understand the file system on Unix system, and the usage of i-nodes
3. Implement the function of sub-directory
4. The task needs to be completed using C++ or C
5.
Tasks/Functionalities
The following functions are required in your file system:
1. Allocate 16MB space in memory as the storage for your file system. The space is divided as
blocks with block size 1KB
Assume block address length is 32-bit;
Design the information contained in i-node
The i-node should support up to 10 direct block addresses
The i-node should support at least one indirect block address
2. The fist block is used for storing the i-node for the root directory(/). While your program is
lunched, two directories (/dir1 and / dir1/dir2) should be created, and also two files need to be
written as /dir1/file1 and /dir1/dir2/file2 (5 marks)
3. File 1 and 2 contain the message of “This is file 1.” and “This is file2”.
4. Following commands should be supported in your system:
a) Create a file:createFile fileName fileSize (10 marks)
i.e.:createFile /dir1/myFile 1024 (in bytes)
if fileSiz > max file size, print out an error message.
The file content is filled up with filename + repeated digits from 0 - 9
i.e.: “myFile012345678901234567890123….”
b) Delete a file:deleteFile filename (10 marks)
i.e.:deleteFile /dir1/myFile
c) Create a directory:createDir (5 marks)
i.e.:createDir /dir1/sub1
d) Delete a directory:deleteDir (5 marks)
i.e.: deleteDir /dir1/sub1 (The current working directory is not allowed to be
deleted)
e) Change current working direcotry:changeDir (5 marks)
i.e.: changeDir /dir2
f) List all the files and sub-directories under current working directory:dir (5 marks)
You also need to list at least two file attributes. (i.e. file size, time created, etc.)
g) Copy a file : cp (5 marks)
i.e.: file1 file2
h) Display the usage of storage space:sum (10 marks)
Display the usage of the 16MB
2014-02-13
IPC读者写者和睡眠理发师问题
两个文件一个主要是读者写者,一个是睡眠理发师。读者写者问题有修改,当写者处于等待状况的时候,新来到的读者不能读入数据库。睡眠理发师问题中理发师有两个。基于windows平台实现。操作系统实验!
2014-01-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人