C + + file Operations Summary:C + + supports the input and output of files through the following classes:Ofstream: File class for write operation (output) (from Ostream)Ifstream: Read operation (input) of the file class (from IStream
I. File types included under Linux 1. Common Files 2. directory file 3. Character special Files 4. Block Special file 5.FIFO 6. Socket 7. Symbolic connectionTwo. Access file control for Linuxchmod using syntax$ chmod [options] mode[,mode] file1
= = System Environment = = =#include pid_t getpid (void);Get the process ID number of the current process and always succeed#include Char *getenv (const char *name);Gets the value of the given environment variable name, and returns a null value if
1.pid_t Fork ();(1) When a process calls fork, the system creates a child process. This child process differs from the parent process in that it has only his process ID and parent process ID, and the others are the same. It's like a process clone
Introduction:A linked list is one of the important members of a data structure. Because of its simple structure, dynamic insertion, deletion of nodes, the advantages of less time, the list in the development of the application of many scenarios.
The topics are as follows:Implement a single function of Linux under tree [only prints the number of directories and the number of files (no hidden files)]Preferred we introduce several related Linux system APIs
Name of function
Original page address: http://blog.csdn.net/kingstar158/article/details/6859379All of the following are reproduced from the above page, thanks to the original author's contribution.In the view of C + + programming ideas, each exercise is basically
(1) VC6 Build DLL Learning below1. Generating a DLL using VC6.0New Project "Win32 dynamic-link Library", enter the project name, select "A Simple DLL Project" and click "Finish". The following is the auto-generated code for the CPP file:#include
C language Socket () function: Establish a socket communicationheader file:
#include #include
To define a function:
int socket (int domain, int type, int protocol);
Function Description: Socket () used to create a new
C language Pause () function: Let the process pause until the signal appearsheader file:
#include
To define a function:
int pause (void);
Function Description: Pause () will suspend the current process (go to sleep state)
Directory (?) [-] Validation of the status marker verification of state flags gets and sets the stream pointer get and put stream pointers binary cache and synchronization buffers and synchronization
In the view of C + + programming thought, each
C language Execv () function: Performing file functionsheader file:
#include
To define a function:
int EXECV (const char * path, char * const argv[]);
Function Description: The EXECV () is used to execute the path of
C language Setlinebuf () function: Set file stream to linear bufferheader file:
#include
To define a function:
void Setlinebuf (FILE * stream);
Function Description: Setlinebuf () is used to set the file stream to change
C language fopen () function: Open a file and return the file pointerheader file:
#include
fopen () is a commonly used function that opens a file in a specified manner, with the following prototype:
FILE * fopen (const char *
C language Pututline () function: Write utmp record to fileheader file:
#include
To define a function:
void Pututline (struct utmp *ut);
Function Description: Pututline () is used to log the UTMP structure of the
C language exp () function: The second power function of E (the x-th square value at the end of E)header file:
#include
EXP () is used to calculate the X-square value, the ex value, at the base of E, and then return the result. Its
A process closes all file descriptors at the end, releasing memory allocated in user space, but its PCB remains.
The kernel holds some information in it: if it's a normal termination, save the exit state and, if it exits unexpectedly, save the
C language cos () function: Cosine valueheader file:
#include
The Cos () function is used to find the cosine value, that is, the ratio of the side length of the angle to the length of the hypotenuse, and the prototype is:
C language Bcopy () function: Copy memory (String)header file:
#include
The bcopy () function is used to copy memory (a string), and its prototype is:
void bcopy (const void *src, void *dest, int n);
"Parameter" SRC is
C language Atoi () function: Converts a string to int (integer)header file:
#include
The Atoi () function is used to convert a string to an integer (int), and its prototype is:
int atoi (const char * str);
The function
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.