# Include # Include # Include Using namespace STD;
Int main (){Time_t rawtime;Struct TM * timeinfo;
Time (& rawtime );Timeinfo = localtime (& rawtime );// Printf ("\ 007the current date/time is: % s", asctime (timeinfo ));Char ABC [20];Sprintf
I.
1. Abs () Absolute Value Function
2. Note that GCC has the math. h header file compiled in Unix/Linux.ProgramWe need gcc abc. C-LM ==> link-LM to indicate the math library.
3. Floor () Ceil () is an integer after (top) the current value. For
Readfile. seekg (-3 * sizeof (person), ios_base: cur );==>Readfile. seekg (-3 * (off_t) sizeof (person), ios_base: cur );
Size_t returned by sizeof () is unsigned,While off_t is signed
F. seekg (-3 * sizeof (s), IOS: cur); ------ this statement
*. Rcachemanage: struct_msg structmsg;
Structmsg = * (struct_msg *) BUF;
Note: if there is a pointer type in the struct, the value assignment will be like performing a shortest copy in a class with a pointer member, and the assignment will fail.
This article recommends some C ++ Learning Forums for you to find a platform for mutual learning and hope to help some computer programmers and those interested in C ++, china's better C ++ learning forums include:
I. Programming entry Network C ++
Simple addition and subtraction may cause problems.For the day of the month, programmers need to consider the 28-29,30-31 and whether the leap month.
No problem
The mktime function considers the case where more than 31 or even less than 0.It will
# Include # Include
Int main (){Time_t rawtime;Struct TM * timeinfo;Int year, month, day;Char * weekday [] = {"Sunday", "Monday ","Tuesday", "Wednesday ","Thursday", "Friday", "Saturday"};/* Prompt User for date */Printf ("Enter year :");Scanf ("%
Job:1) Use the pointer type and reference type to implement a value exchange function.Swap (string * a, string * B)Swap (string & A, string & B)2) Design a function to concatenate two string parameters into a new large string and return it to the
1. Introduce STL. How does STL implement vector?
STL is composed of containers, algorithms, and iterators. Advantages: 1. Easy to perform a series of operations on data: sorting, searching, inserting, adding, and deleting. 2. Convenient and secure
1. Range of different data types. Such as int char
6. Integer variable (INT): Short INTEGER (short INT) (-30 thousand ~ 30 thousand) (2 bytes), General INTEGER (INT) (-2.1 billion ~ + 2.1 billion) (4 bytes), long integer (there is no difference
Part 4: Object-oriented programming and generic programming.
Chapter 2: Object-oriented Programming.
1. Object-oriented three basic concepts: encapsulation, inheritance, and polymorphism.
2. In C ++, dynamic binding occurs when a virtual function
Merge sort is another type of sorting method. The meaning of merging is to combine two or more ordered data sequences into a new ordered data sequence, therefore, it is also called the merge algorithm. The basic idea is to assume that array A has n
In C ++, the map container provides a key-Value Pair container. The difference between map and multimap is that multiple allows a key to correspond to multiple values.
1. Map description1 header file# Include 2 DefinitionsMap my_map;Or typedef Map
Today, a friend asked me a question about the pre-declaration in C ++. The following is my answer.
When writing a C ++ program, you occasionally need to use a forward statement ). In the following program, the line with annotations is the
Today, I think of these two problems when I was working on the project. So I tested the actual programming and got some new gains:
I always thought I was familiar with how to use the binary files in C/C ++. However, during the test today, I
C ++ does not provide any multithreading mechanism, but in windows, we can call the SDK Win32 API to Write multi-threaded programs. The following is a brief introduction:
Function used to create a thread
Handle createthread (
Lpsecurity_attributes
C ++ Introduces New Explicit conversions such as const_cast and reinterpret_cast, even some experienced C ++ programmers make mistakes in some details. It is true that since we can simply write:
Int I = (INT) P; // P is apointer
Why should we use
1. Simple examples of Enum EnumerationWhen writing a program, we often need to associate a set of optional alternative attributes for an object. for example, student scores include a, B, c, d, sunny, cloudy, and rainy.More often, opening a file may
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