c language -- detailed explanation of common string functions and sizeof

1.sizeof use a. Code 1 int main() { int a = 0; int arr[] = { 1,2,3,4 }; printf("%d\n", sizeof(a)); printf("%d\n", sizeof a); printf("%d\n", sizeof(&a));//Indicates the size of the address printf("%d\n", sizeof(int)); printf("%d\n", sizeof(arr));//Calculates the size of the array arr in bytes printf("%d\n", sizeof(arr)/sizeof(arr[0 ...

Posted by daveyc on Fri, 05 Nov 2021 15:33:05 -0700

Chapter III summary

3.1 cited examples [example 3.1] calculate the Celsius temperature corresponding to the Fahrenheit temperature of 100 ° F. Calculation formula:                            c= Where: represents the temperature in Celsius and f represents the temperature in Fahrenheit. #include<stdio.h> int main(void) { /*Define 2 integer variables. ...

Posted by olivarespablo on Fri, 05 Nov 2021 13:47:32 -0700

Dynamic memory management (heap)

catalogue Why is there dynamic memory management How to manage space? Introduction to dynamic memory functions malloc and free calloc ​ realloc Common dynamic memory errors Written test questions Flexible array   Use of flexible arrays Advantages of flexible arrays Why is there dynamic memory management 1. You can a ...

Posted by seaten on Fri, 05 Nov 2021 13:30:55 -0700

Function stack frame explanation

preface This module is close to the boundary of C language and takes some time to learn. However, when we know this knowledge, we can see more than the appearance in the function of C language, and we can really understand how the function is called. However, my ability is limited. If the following knowledge is inappropriate, please correct it ...

Posted by YoussefSiblini on Fri, 05 Nov 2021 12:09:24 -0700

[problem solving report] 100 cases of introduction to C language (case 4)

  Zero, write in front          This series is not updated frequently. It's interesting to see today's topic. Let's have a look. The main knowledge points are [question 04] given a and b, ask whether a can be divided by b. The Application of if statement and conditional operatorhttps://blog.csdn.ne ...

Posted by Mew151 on Fri, 05 Nov 2021 11:24:26 -0700

C transition C + + Foundation (more detailed)

catalogue preface 1, The difference between C language and C + + 2, Input and output 1. Transplantation of C standard library 2.C + + standard input / output stream 3, Reference variable 4, Difference between functions ​ 5, User defined type 6, Dynamic memory allocation 7, Student achievement analysis Insert a message this pointer ...

Posted by chrispos on Fri, 05 Nov 2021 10:44:19 -0700

Linux Source Parsing--From Initialization of main Function to Open Interrupt

The three assemblers that are executed before the Linux system starts are mentioned above. The head.s program actually enters the Linux source code written in C by jumping out of the main function stack and into the main function execution. Previous article can be jumped here Linux Source Parsing - From Startup to main Function Based on the Li ...

Posted by php3ch0 on Fri, 05 Nov 2021 10:03:17 -0700

C Language Foundation

Han Soldiers Hanxin has a troop of soldiers, at least M. He wanted to know how many people there are, so he asked the soldiers to queue up to report the number. From 1 to 5, he wrote down the number reported by the last soldier to be 1. Then count from 1 to 6, and write down that the last soldier reported 5; From 1 to 7 the last soldier was rep ...

Posted by gordsmash on Fri, 05 Nov 2021 09:24:04 -0700

C/C++ getchar function - C language zero foundation tutorial

catalogue 1, Introduction to getchar function 1.getchar principle2.getchar function declaration3.getchar usage scenario 2, The getchar function uses3, Clever use of getchar function4, Guess you like it Zero foundation C/C + + learning route recommendation: C/C + + Learning directory >> Introduction to basic C language 1, Introd ...

Posted by darence on Thu, 04 Nov 2021 22:49:50 -0700

Custom types: structure, enumeration, union

1, Structure Declaration of structure: For example, describe a student: struct Stu { char name[20];//name int age;//Age char sex[5];//Gender char id[20];//Student number };//Semicolons cannot be lost Special statement: //Anonymous structure type struct { int a; char b; float c; }x; struct { int a; char b; float c; }a[20 ...

Posted by interrupt on Thu, 04 Nov 2021 19:30:43 -0700