Terms 2:prefer Consts,enums,and inlines to #definesTry to replace # define with Const,enums,inline.#define是预处理器中宏定义.For example, # define PI = 3.1415926, this is equivalent to replacing all symbol occurrences in the code with the value 3.1415926
1. [Code][c/c++] CodeService side://Main.mServer//Created by Mac on 13-4-15.Copyright (c) 2013 Mac. All rights reserved.//#import #import #import #import #import int Createserversocket (short port){int socket_server=0;Socket_server=socket
1. [Code] easy to write your own input URL, here to test an example#include #include #include #include #define MAXN 1024+10char URL [maxn] = "Http://www.google.com:80/wiki/Search?search=train&go=Go#steammachine";int main (){const char
I remember the interview was asked the smart pointer implementation, when the smart pointer just heard but did not know, and then said in a muddle. Today I wrote the smart pointer, using the concept of reference counting.The main idea is to use a
Inline functions: You can avoid the overhead of function calls, and inline functions are similar to macros, except that macros are substituted by a preprocessor for macros, and inline functions are implemented by compiler control. and the inline
Recently to invoke the WebService interface with C + +, the intermediate tool is the Gsoap,ide:vs2010,webservice interface: http://webservice.webxml.com.cn/WebServices/ mobilecodews.asmx?wsdlWith regard to soap, it is a simple Object access protocol,
Joseph Ring:Known n individuals (denoted by number 1,2,3...N) sit around a table. From the person numbered K began to count, the number to m of the person out of the man, and his next person from 1 began to count, the number to m of the person again,
Delegate is the. Net version of The addressing Method The required parameters are listed on the left of the lambda operator "=> ".The implementation code of the method to grant Lambda variables is defined on the right side of the lambda
C # Fill in zero when the number of digits is insufficient:Int I = 10;Method 1: console. writeline (I. tostring ("D5 "));Method 2: console. writeline (I. tostring (). padleft (5, '0'); // recommendedMethod 3: console. writeline (I. tostring ("00000 "
Today, I read C # (my book is "C # Getting Started classic"). When I saw the ternary operators, I couldn't understand them for a moment, because the book has very little space on the ternary operators, simply put, "string resultstring = (myinteger
public AtmDataBase DeepClone(){ MemoryStream ms = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, this); ms.Position = 0; return bf.Deserialize(ms) as AtmDataBase;}
The above is the depth clone of the C #
Find the substring with the longest repeat times in a string and calculate its repeat times. For example, the string "ABC fghi bc kl abcd lkm abcdefg" and returns "ABCD" and 2.
Because the question requires that the longest substring be repeated at
In the system. Speech namespace, The speechsynthesizer class can read the text and play it together ~~
First, introduce system. Speech in the Windows Forms project. Interface section:
The background code is also very simple, but some methods
Static classes cannot be instantiated. We directly use their attributes and methods. The biggest feature of static classes is sharing.
ExplorationPublic static class statictestclass
{
Public static int n = 0;
Public static void add ()
{
N ++;
}
}
1. first introduce the namespace using system. net. mail;
2. the mail function is encapsulated into a class, which includes the basic functions of sending mail: recipient (multi-person), CC (multi-person), sender, subject, body of mail, attachments.
1. [Code] [C/C ++] Code/** Copyright (c) 2011, Jim Hollinger* All Rights Reserved.** Redistribution and use in source and binary forms, with or* Modification, are permitted provided that the following conditions* Are met:** Redistributions of source
Double-click "app. config" in the Solution Explorer list and the following code is displayed:
1 2 3 4 5 6
Add the Code marked in red at the top of :
1 2 3 4 5 6 7 8 9 10 // bin is the directory for storing DLL files 11 12
In sublime text, Click Tools> build system> new build system.... a configuration file template is displayed, replacing the content in the template with the result:
[Convert] memmove function, memmove Function
[From msdn & encyclopedia]
Prototype:Void * memmove (void * dest, const void * src, size_tcount );
# Include
Copy count bytes from the memory area indicated by src to the memory area indicated by
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