1. Comments
Single-line Comment
/*
Multi-line comments
*/
A single-line comment is generally written in two places, and a single line of comments generally explains what
Why did you do this?
int add (int a,int b) {
Return a+b;//Why did you do this?
}
2, the writing of the head file
#include "header" header file is defined by itself
#include
3. Xcode basic shortcut keys
CTRL + N (next) cursor jumps to the next line
Ctrl+p (Previous) cursor jumps to the previous line
Ctrl+b (back) cursor moves one character to the left
CTRL+F (ForWord) cursor moves one character to the right
Ctrl+h Delete one character to the left of the cursor
Ctrl+d (delete) Delete one character to the right of the cursor
Ctrl+e (end) cursor jumps to end of line
CTRL + A (Ahead) cursor jumps to the beginning of the line
Ctrl+k (Kill) Delete all content to the right of the cursor
Ctrl+i Automatic Formatting
Commond+z back to previous action
Common +/multiple lines of comments or uncomment
Common's +a Select all
4. Variables
The basic unit of computer storage data is byte bytes
1 byte=8 bit
1 in binary notation 0x0000 0001
20 in binary notation 0x0001 0100
Variable type:
Integer variable 4byte=32 bit
int totalman = 2;
printf ("%/d\n", totalman);//Output method
Long Shaping variables
Long Guangnian = 32;
printf ("%/ld\n", Guangnian);
Character Variable 1byte
Char alpha = ' A ';
printf ("%/c\n", Alpha);
Floating-point variable single precision 4byte reserved six digits after the decimal point is omitted
FLOAT score = 90.5;
printf ("%f\n", score);
printf ("%.1f\n", score);
Double Precision 8byte
Double pi= 3.1415926;
printf ("%f\n", pi);
Xcode basic shortcut keys and several common variables