The global variables and static local variables are stored in the global data zone. The initialized and uninitialized variables are saved together;
Common local variables are stored in the stack;
What is the difference between global variables and
For uncertainty issues, find a way to confirm, or wait for you will be a Bug-programming experience
When I added a control and monitoring module to the project in Nanjing last month, I wrote the Code. The Code contains the following sentence:[Cpp]If
# Include Void fa (int a)/* Changing a in the function will not bring back the main function (a in the main function is still the original value )*/{A ++;Printf ("in function fa: a = % d \ n", a); a = 2}Void fb (int * a)/* a is a pointer type.
This program uses a time seed to randomly generate 10 integers [-5 ~ 5]. The function is randData (). There is also a function ZeroSubarray () that calculates the subsequence as 0 ().RandData () is as follows:[Cpp]Int arr [10];Void randData (int a []
I. pointers and Arrays1) in C language, there is only one-dimensional array, and the size of the array must be determined as a constant during compilation.2) For an array, we can only do two things: determine the size of the array and obtain the
[Cpp]///*Binary Search is an algorithm based on sorted order. Low complexity and high efficiency,Because the project uses a lot of binary searches, but each business cannot implement oneTherefore, it is necessary to implement a common binary
[Html] /* implement the Runnable interface to create a Thread class to share a data [html] compile a train station ticketing program -- sell tickets in three windows at the same time */class PP implements Runnable {// class PP public int tickets
Question: I recently read a C-language book. It seems quite good, but there are some mistakes in the book. At the same time, I found some things that are easy to be ignored by myself or everyone, so I will write down and share them with you. If
Not to mention how common typedef is, the most common is typedef struct. So the powerful type definition character typedef can also be used to define functions. Do you know? The following accurate code can be used to explain the problem: typedef int
Pointers are a "Language Mechanism" of C language. The difference is that, if a pointer is used normally, it is a common tool. Instead, it only modifies the real parameter by passing the address to the function, array positioning is essentially a
During the interview, programmers often encounter some questions, give a struct, and then sizeof it. What is the value? For example, the following structure is provided: [cpp] struct test {char a; short B; char c; int d ;}; maybe some students who
We all know that the char type occupies 8 characters and the int type occupies 16 digits. What will happen when the int value is assigned to char? What are the processing rules?
Method 1:
Write the following code for testing:
[Html]# Include #
The Code branch can better find the cause of the error and modify it.Note: To Learn programming, you must learn how to debug and troubleshoot the code. Otherwise, it will be hard to do!Requirement: understand the purpose and skills of debugging. Do
[Cpp]# Include # Include # Include Typedef struct myList DNode;Struct myList{DNode * next;DNode * prev;Int data;};DNode * init (int data );Void insertLastNode (DNode * L, int data );Void insertNode (DNode * L, int data );DNode * findPrev (DNode * L,
Print? /* 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
Print? /* 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
A few days ago, in the QQ group, I found some friends discussing why the value can be passed and the address can be passed after the function is returned. I am also curious,So I followed it.
Int * sum (int x, int y){Int;A = x | y;Return &;}
Problem description:N items and a backpack are given. The Weight of item I is w [I], the value is v [I], and the size of the backpack is c. How should we select the items to be loaded into the backpack to maximize the total value of the items in the
[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
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