How to create and delete an object in C ++

Source: Internet
Author: User
The problem is:
1. Design a file system for N users. Each user can save up to M files.
2. Only one file can be opened at a time.
3. The system should be able to check the correctness of the input command, and the cause of the error should be displayed.
4. You must set protection measures for files, such as read-only, write, and execution. You can set the protection level again when you enable it each time.
5. There are at least the following commands for file operations:
Create: create a file
Delete: delete an object
Open: open a file
Close: Close the file
Read: read an object.
Write: Write a file
I want to ask:
1. Which function in the fstream. h header file can be used to delete files?
2. After installing msdn, how can I see the methods of ifstream or ofstream objects? For example, EOF ()?
I have a C ++ standard template library in hand, but I think it is almost useless. The fstream description does not mention functions such as deletion.
If you are familiar with the Runtime Library, you can also consider the Runtime Library

System ("");
The command for adding DOS to quotation marks is also OK.
INT system (const char * command)

Using the above function, the command is the console command you need to call, such as del and rmdir.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.