Use of STL in VC ++

zhaozj2021-02-11  194

The use of STL in VC --- Visaul C as an excellent programming tool, has become more and more popular, I use C & C has a considerable time, I found that C language is profound, now just a simple Example: ---- Distinguished data structure in the programming, is it yourself to rewrite the entire code? ---- Or use the ready template? In fact, Visual C provides very good STL for everyone to use, taking a chain table as an example: MAP

> m_string; Use the above statement to construct a linked list of the following structure: typedef struct list

{

String name;

String value;

List next;

List;

The main operation of Map has functions such as INSERT, FIND, END.

#pragma Warning (Disable: 4786)

#pragma Warning (Disable: 4788)

---- The above two-line statement prevents compilation warnings from MSDN to #include

#include

String & map header file, you can't add .h

Using namespace std;

Typedef Map

> Int2string;

INT2STRING M_TEST;

void main ()

{

// Can add code ...

Return;

}

---- The above-mentioned version of the chain table MAP I paid the program is the time I am testing the CGI program when using the MFC class, now I am interested C enthusiasts welcome questions about there are questions, and improve ---- My E_MAIL IS: Guiyongfu@163.net ---- First, use Visual C App Wizard New -> Project-> Win32 Console Application .... ---- A short description of the function of the function:. --- - 1) AFXWININIT: When using MFC, it is necessary to initialize the function. ---- Changeformat: Processing the string, such as turning the ' ' number into spaces, etc. - or more only my test program, you can make these functions into a class for later use

转载请注明原文地址:https://www.9cbs.com/read-4012.html

New Post(0)