1. C # is not part of. Net itself .. Some of the features supported by net are not supported by C. While C # does not support some other features, such as operator overloading)2. Compilation is divided into two phases:(1)Source codeCompiled into
Today, I learned about the interoperability between C ++ and Lua, And It Feels simple. It is not as mysterious as it was before.
The following is a good learning material. I don't know if it is the original source. Anyway, I found it only in
1. Compilation and link
SetProgramConvert to ExecutableCodeC language is divided into three steps:
A. Pre-compile. The program will first be handed over to the pre-processor, the pre-processor executes the command starting with #, then adds the
1. typedef
In the previous article, we used macro definitions to define a bool type, so now we use a more professional method to define the type.
Typedef intBool;IntMain (Void){Bool flag = 1;If(FLAG){Printf ("True");}Else{Printf ("False");}}
StringbuilderIt turns out to be a collection based on a linked list rather than an array. Instead of increasing capacity by 2, it adds a stringbuilder node with the capacity of int num = math. max (minblockcharcount, math. min (this. length, 8000);
In my. Net class last day, I wore a T-shirt with three Nirvana people printed on the front. The middle was Kurt Cobain, with a smile.
The teacher saw me and said, "Hey, didn't you print the people on your clothes that wrote" C # entry classic ?"
In the compilerProgramA token is a lexical analyzer.
Token: the most basic component unit of a program. It is the basic unit of the program definition. A token must represent the same meaning and semantics wherever it appears.
When performing
In C, complex types are often declared. Most of them involve pointer types.
Let's take a look at this section.
First, let's first understand the combination of *, () and. Before looking at the actual example, let's look at an important rule:
1. Dynamic Memory Allocation
First, we will introduce three functions for dynamic memory allocation: malloc, calloc, and realloc. Sorry, I used to only know about malloc. Now let's look at their differences:
Malloc: The most common memory block
1. Getting started with strings
A string is also called a string literal. It is a character sequence enclosed by a pair of double quotation marks.
We may often encounter character strings that are particularly long. in C #, we usually use the @
1. Conditional compilation
Conditional compilation means that preprocessing is included or excluded based on the test results.Program.
2. # If and # endif
Let's not talk about it. Let's just give an example.
# DefineDebug 1IntMain (Void){#
Author: Chen taihan
Yes. We hate to generate temporary variables because they occupy our memory and consume our CPU time.ProgramReduced performance. But sometimes it is necessary.
When Will annoying temporary variables be generated?
There are
This morning I saw "do you really know a ^ = (B ^ = (a ^ = B)?" Article,ArticleAn interesting expression: A ^ = (B ^ = (a ^ = B );Program:
1
Int
A
=
2
;
2
Int
B
=
9
;
3
A
^ =
(B
^ =
This is a Windows-based client server written in C ++.ProgramSuitable for beginners.Source code must be shared
The idea is as follows. start the server. After the server is started, a subthread is created to send messages to the client. an
C ++ uses arrays and linked lists to implement queue
Yesterday I wrote 《C ++ uses arrays and linked lists to implement Stack", Today is 《C ++ uses arrays and linked lists to implement queue",
The queue is first-come, first-served, and then
1 : JIT (Instant compilation ). When a method is called for the first time JIT Will change the method Il CodeConvert CPU Command. When you call this method again, you only need to execute the corresponding command. The first call process of
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
# Include
Stdio. h
>
# Include
Windows. h
>
# Include
Wininet. h
>
# DefineMaxsize 1024# PragmaComment (Lib, "wininet.
I. Preface
This article describes some basic usage of gtest, including downloading, installing, compiling, creating our first test Demo project, and compiling a simplest test case. Ii. Download
If you do not remember the URL, search for gtest in
Let's just get started. First lookProgram:
Code1 class Program2 {3 static void main (string [] ARGs)4 {5DynamicFoo1 = new Foo ();6 foo1.do1 ();7 foo1.do2 ();8Foo1.kissfanweixiao ();9}10}1112 public class foo13 {14 public void do1 () {console.
1. Bit domain
Let's look at a struct representing a date:
Typedef struct{Unsigned intYear;Unsigned intMonth;Unsigned intDay;} mydate;
However, we can find that in fact, year cannot exceed four digits, month is 12, and day is 31. However, in
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