C language problems (continuous updating)

Source: Internet
Author: User

1. c language declaration:All the strings you declare in the C language will have different meanings based on what you declared at the beginning! Your declaration on the string represents the attributes of this string! Whether it is a variable or a function depends on your declaration! For example: int func (void), this declaration is a typical function declaration, and then the func string appears, that is, the call to the func function! The func string represents a function, that is, the address of a processing process! Int a [2], which is declared as the address of an array. Therefore, the first address of the array is displayed in a string!2. Problems with functions and labels:Functions and labels represent the routine address, which is the instruction code set for processing a thing. What is different between functions and labels is that functions have parameters and return operations, the label is just a string of instruction sets executed in sequence!
3. Warnings for compiling in Linux: ISO C90 does not allow mixed use of statements and code.

Because Linux is written in C language, it follows the principle of first defining and then using;

It is specified that input or output statements or other statements that call functions cannot appear before variables are defined;

All function call statements must appear after the variable type is defined;

Example: void fun ()

{

Printf ("This is a strange World! \ N ");

Int I;

Char buf [128];

}

If the program runs, the preceding warning is displayed: ISO C90 does not allow mixed use of statements and code.

Correction Method:

Void fun ()

{

Int I;

Char buf [128];

Printf ("This is a strange World! \ N ");

}
4. access controllers in C LanguageCompared with the access control operators in C ++ or Java, the access control operators (static) in C language are only used to control the scopes of functions and variables!
5. static storageStatic Storage refers to the way to allocate a fixed storage space while the program is running, which corresponds to the dynamically allocated stack storage space. In the C language, static variables are stored in the static storage area, but not all variables in the static storage area belong to static variables, and global variables exist! When a global variable is defined as static, the global variable can only be used by functions in the file module where it is located. Functions in other file modules cannot be accessed!

Related Article

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.