Years I learned C [ch02]: Macro, struct, typedef, ch02typedef
C language compilation process:
Preprocessing
Compile
Assembly
LinkThere are three situations in Preprocessing:
File Inclusion (# include)
Conditional compilation (# if, # ifndef, #
Replication of complex linked lists in c Language
// Header file # pragma oncetypedef int DataType; typedef struct ComplexNode {DataType _ data; // data struct ComplexNode * _ next; // pointer to next node struct ComplexNode * _ random; // point to
Objective-C Block
Block Code block is a feature of OC. In addition to executable code, it may also contain automatic variable binding (stack) or memory hosting (HEAP ). Therefore, a block maintains a state set (data) and can be executed at any time.
Simulate user logon in C language and only log on three times
Include # include int main () {// defines the reserved password char key [] = "123456"; char input [10]; int I = 0; // enter the password and password for (I = 0; I
Write a program using C language to output each bit of a number (multiple methods)First:
# Include int main () {int zheng, I; int m = 0; int yu [10]; int count = 0; scanf ("% d", & m ); zheng = m; for (I = 0; I
Second:
# Include int main ()
C language, c1. Fast Sorting Algorithm
1 # include 2 3 struct node 4 {5 int key; 6}; 7 typedef struct node DataType; 8 9 int Qukpass_sort (DataType Ar [], int s, int t ); 10 int Quk_Sort (DataType Ar [], int s, int t); 11 12 int main (void) 13 {14 1
Calculate the factorial and sum of n using C language (multiple methods)Calculate the factorial of a certain number:
# Include int main () {int n, I; scanf ("% d", & n); for (I = n-1; I> 0; I --) {n = n * I;} printf ("% d", n); return 0 ;}
C language, cI. Task
One class has m girls and n boys (m is not equal to n). Now we have a dance. The boys and girls sat on the chairs on both sides of the dance floor. At the beginning of each song, one of the boys and the girls danced together,
C language pointer, C language pointer
Pointers are very important data types in C language. What are pointers?
The pointer type is a variable used to store the variable address, pointing to a variable.
Common pointer format: * pointer variable
[C Language] implements the itoa (int n, char s []) function, converts the integer n to the corresponding string, and saves it to s.
# Include static int I = 0; // defines the global variable I as the subscript of the array s [] int itoa (int n,
C language-three solutions for String LengthProblem: three solutions for finding a string I. Counting Methods
#include#includeint my_strlen( char* str){ int count=0; while (*str) { count++; str++; } return count;}int
[C Language] extract substring
Compile a function that extracts a substring from a string. The function is prototype: int substr (char dst [], char src [], int start, int len) {}. The target is: start from the start position of the src array and
Interesting C language appletsDetermine the output content of the following program:
#define _CRT_SECURE_NO_WARNINGS 1#include #include int main() { int i=43; printf("%d\n",printf("%d",printf("%d",i))); system("pause"); return 0;
Small games implemented in C Language
# Include void menu () {printf ("*************************** \ n "); printf ("************ 1> start ********** \ n "); printf ("************ 2> exit ********** \ n "); printf ("*************************** \ n")
C language: Write a function, strcpy, dest, src, which extracts a substring from a string.
# include # include # include // chain access char * my_strcpy (char * dest, const char * src) {char * ret = dest; assert (src! = NULL); assert (dest! =
Use C language to calculate a simple mathematical formula
// Calculate the sum of the first five items of Sn = a + aa + aaa + aaaa + aaaaa, a is a number // such as 2 + 22 + 222 + 2222 + 22222 # include int main () {int num = 0; int n = 0; int sum
Dynamic Display of digital tubes and dynamic display of digital Tubes
Lab Board: TX-1C --- eight-segment digital tube using co-cathode connection
Content: Display 123456
Principle: The Dynamic Display feature is to link the Line Selection of
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.