C + + random function (VC program):
#include
#include
#include
using namespace std;
#define MAX
int main (int argc, char* argv[])
{
srand ((unsigned) time (NULL)); The Srand () function produces a random seed for
Mci_open_parms is a structural body type, whose structure is defined as
typedef struct {Dword_ptr Dwcallback;Mcideviceid wdeviceid;//Setting IDLPCTSTR lpstrdevicetype;//Device TypeLPCTSTR lpstrelementname;//filenameLPCTSTR lpstralias;//Alias} mci_
Priority level
Operator
Name or meaning
Use form
Combining direction
Description
1
[]
Array subscript
array name [constant expression]
Left to right
()
Parentheses
(expression)/
log4j-C + + class log processing project Daquan
log4c
Summary: ANSI C functions and macros for flexible logging to files and other destinations. It is modeled on the Log for Java Library (http://www.log4j.org) and staying as close to their API as
1, using the C language function
Converts the number value of an integer to its equivalent stringchar *itoa (int value, char *string, int radix)
Parameters (parameter description)First argument: value number to is converted (the value that will be
function to draw a bitmap in hdcdest
Get Desktop Code:
CDC *PDESKDC = GetDesktopWindow ()->getdc ();
CRect re;
Get the size of the window
GetDesktopWindow ()->getclientrect (&re);
CBitmap bmp;
Bmp. CreateCompatibleBitmap (PDESKDC, re. Width (), Re.
a keyword in c language--static
Static in C language has two functions, the first is to modify the variable , the second is the modifier function .
1. Static modifier variable
According to the scope of action, the variables are divided into local
virtual function and pure virtual function usage in C + +
1. Virtual functions and pure virtual functions can be defined in the same class (class), classes containing pure virtual functions are called abstract classes (abstract class), and classes
Computer/web Books!
If the directory is available:DirectoryInfo thefolder = new DirectoryInfo (PathName);if (thefolder.exists){。。。。。。。。。。。。。}If the file is available:FileInfo thefile = new FileInfo (PathName);if (thefile.exists){。。。。。。。。。。。。}Using
The main content of this article is the summary of some knowledge of C + +, convenient for their own easy to see and review, that is, the way to record their own understanding, some of the specific code or something too lazy to write, if you still
1. Structure Size
int *pi = new INT[12]; pi is purely a pointer variable, it is a pointer to 4 bytes in a 32-bit environment, while the IA in int ia[]={0, 1, 2}, is a number group, although its value is the address of the first element, but it
Principle: Similar to function pointers in C and C + +.
Statement: Using the delegate keyword
public delegate void Del (String message);
Construct: Provide the name of the method you want to wrap or use the anonymous method
Method 1: Provide the
1. Always use properties to replace accessible data members
2. Between readonly and const, priority is given to the use of ReadOnly
3. Use the AS operator as a priority between as and coercion type conversions
4. Use conditional attributes
The first file list
Posted on Saturday, September, 9:11 PM
The first file listC, traditional C + +#include //Set insertion point#include //character processing#include //define error codes#include //floating-point processing#include //File
#include
#include
typedef int ELEMTYPE;
/* ********************************************************************** */
/* The following are 6 algorithms for queue sequential storage operations * *
/* *************************************************
1. Introduction
In WMI, you can obtain information about a disk drive by using the Win32_Processor object:ManagementClass mc = new ManagementClass ("win32_cdromdrive");Managementobjectcollection MOC = MC. GetInstances ();foreach (ManagementObject mo
Why do you have to new/delete if you have a malloc/free?malloc and free are standard library functions for c++/c languages, and new/delete are the operators of C + +. They all canUsed to request dynamic memory and free memory.For objects that are
The difference between heap and stackFirst, the preparation of knowledge-Program memory allocationThe memory used by a program compiled by C + + is divided into the following sections1, stack area (stack)-by the compiler automatically assigned to
Keep in mind srand () do not call two times or more than two times.
void Main (){for (int i=0;i{Srand ((unsigned) time (NULL));Cout}}
When this is called, the Srand ((unsigned) time (NULL) is invoked because of the high speed relationship of the
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