A very useful symbol defined by a macro in c #

    # Include # Include # Include     # Define IsMan (name) pr_value (# name, name) // The key point is # name, which creates "\" "+ name +" \ "to pr_value # Define WANGYONG 1 # Define YONGXIN 2   Void pr_value (char * name, int type) { Switch

Explanation of C assertions/static assertions

Assertions can be used as a powerful debugging method or an error diagnosis during program running.However, assertions are not suitable for various places. server software and embedded programs are generally not applicable. Assertions force the

C/C ++ on Liunx platform Article 2: I/O

UNIX APIs provide the most basic IO functions and are declared in fcntl. h unistd. h. (Fcntrl fd control)The application uses file descriper (file descriptor) to interact with the kernel.These functions are called unbuffered I/O.In UNIX, everything

Determine the number of replies

1 // question: a five-digit query to determine whether it is a return number. That is to say, 12321 is the number of replies, with the same number of digits and tens of thousands of digits.2 # include 34 int main ()5 {6 int num = 0;7 printf ("please

A general Makefile

We develop programs in the Linux environment and have to write Makefile by ourselves. A slightly larger project will contain many. c source files.If we use gcc to compile each source file one by one, the efficiency will be much lower. However, if we

HDU 2964 Prime Bases

The idea of solving this problem is to calculate the coefficients one by one from the largest to the smallest base.Why can we design algorithms like this:1. n = a0 + a1 * p0 + a2 * p0 * p1 + a3 * p0 * p1 * p2 + ..., it indicates that every n of the

Lua5.2 how to implement Continuation in C call

The most significant improvement of Lua 5.2 was "yieldable pcall and metamethods ". This requires us to overcome a difficult problem: how to correctly call yield back to resume in the C function call. Resume is always initiated through a lua_resume

Summary of string processing functions in C and C ++

I. Functions in the Character Processing Library# Include Function prototype: int f (int c)Function Description: the C language defines whether to process character operations, including whether it is a number, letter, print character, hexadecimal

Lua and c

I recently used lua to write game server logic.Writing server logic with lua is much simpler! You know! The first problem is about the return value of lua's C call.// Test the returned table/**The following code is equivalent to lua:Function

Http protocol instance

# Include # Include # Include # Define Max size 1024# Pragma comment (lib, "Wininet. lib ")Void urlopen (TCHAR *);Int main (int argc, TCHAR * argv []){TCHAR ch [] = TEXT ("http://dt.163.com/images/news/0605/news02053101_5.jpg ");Urlopen (ch

C Data Structure: Stack function: Implement recursive relationships using stacks and Recursion

Manual introduction to the specific data process makes it easy to understand and select stacks to deal with recursive Problems2. m = 3, n = 4. If the stack size is only 100, it is not enough.(The complexity problem cannot be found at the beginning) 0

Variable Parameter macro _ VA_ARGS __

The macro definition uses variable parameters, which makes it much easier to use. For details, refer to the msdn example:   Support for variadic macros was introduced in Visual C ++ 2005. // Variadic_macros.cpp# Include # Define EMPTY # Define CHECK1

Select the top 10 [heap sorting version] From N

Question: select the top 10 largest N numbers for ordered output. N up to 100 billion. Each number range is 0-2147483647 heap Sorting Test Result: total [1000000] Input total comparison [4232804] Total write memory [3849024] total time consumed [0.04

Large operating system experiment progress (1) ----- c ++ Initialization File

[Cpp] # include # include using namespace std; FILE * fp; char SP_NAME [] = "cq. dat "; int BLOCK_NUM = 65536; // 64*1024 int BLOCK_SIZE = 512; # define biteNum 33554432 // 64*1024*512 void init () {int I, j; fp = fopen (SP_NAME, "w"); // file

[C and pointer] # if 0 # end if

1. The role of "# if 0/# if 1... # endif" is 1) the code defined in the code is the code of some debugging versions. At this time, the code is completely ignored by the compiler. If you want the code to take effect, you only need to change # if 0 to

Read a source code line written in C Language

Because of work requirements, I wrote a function to read a row in C language for your reference: [cpp] static BOOL readLine (FILE * file, char ** ppBuf) {int nMax = 128; char szBuf [128]; char * pAmountBuf = NULL; char * pResult; int nLen = 0; int

C language Vulnerability Detection and filling-Keyword

Register keyword Register declares the Register variable [try to store the variable in the internal CPU Register, not absolute] CPU reads data: memory -- register -- CPU Although the register speed is very fast, there are limits: The register

Question: Armstrong count (continued)

[Plain]/* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)* Copyright and version Declaration of the program* All rights

Question 84: Decomposition factor

Print? # Include  Int main (){Int I;Int j = 0;Int begin_num;Int num;Int mark;Int count [100];Int collect [100] = {0 }; Printf ("please enter a number :");Scanf ("% d", & num );Begin_num = num; // use begin_num to keep num. The following Operation

Classical c Programming

/* Multiplication table */ # Include Int main (){Int I, j;Printf ("multiplication table \ n ");For (I = 1; I {For (j = 1; j Printf ("% d * % d = % d", j, I, j * I );Printf ("\ n ");}Return 0;}   /* Prime number less than 100 */# Include # Include

Total Pages: 275 1 .... 264 265 266 267 268 .... 275 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.