The basics of C language for iOS development-Introduction to data types and operators?
1. The TurboC variable must first define its data type before use. unspecified variables cannot be used. The variable type should be defined before the executable statement. In the preceding example, the first statement in the main () function is the variable definition statement, which must be placed in the first statement.
Before clrscr.
2. In TurboC, uppercase and lowercase letters are different. The uppercase and lowercase letters of the same letter indicate different variables.
3. The writing format of the TurboC program is very flexible and there are no special restrictions.
Example 1 The main function can be written as follows:
Main () {charc; clrscr (); gotoxy (12, 3 );
Puts ("WelcometouseTurboC2.0! "); Gotoxy (15,13 );
Printf ("-- Continue"); gotoxy (15, 15 );...}
In this way, although the syntax is correct, it is not very good to read, and the program level is not clear. Therefore, it is recommended that you use TurboC to program a line of statements, and the nested statements are indented backward. If you need to add comments to the program, you will understand this.
The general format of TurboC source code is:
Include files
Description of subfunction types
Full variable definition
Main ()
{
Local variable definition
<Program body>
}
Sub1 ()
{
Local variable definition
<Program body>
}
Sub2 ()
{
Local variable definition
<Program body>
}
.
.
.
SubN ()
{
Local variable definition
<Program body>
}
Sub1 (),..., subN () represents User-Defined subfunctions. The program body refers to any library function call statements and controls provided by TurboC2.0.
Process statement or other sub-function call statements.
C language is the basic language for iOS development. If you are interested, you can keep an eye on my new developments and share your development skills and skills with you every day. Attention to http://weibo.com/u/1796275655