2015.1.19
The first day began to study, stay to review after.
MacOS System: Is the UNIX system graphical interface display, development tools: IDE (Xcode) and terminal (terminal)
Shortcut keys:
Command (Windows) + C: Copy
Command + V: paste
Command + x: Cut (only valid within the current application)
Show clipping function under Mac System: Command + x then press option (ALT) +command + V
Command + N: Create a new application
Command + TAB: Switch applications
Command + F: find
Command + Z: Undo
Command + SHIFT + Z: anti-undo
Command + Space: Toggle Input Method
File system:
/: Indicates root directory
User directory: The directory where the current user action is saved
Current directory: The directory in which the user is currently operating, the current directory with "."
Parent directory: The top-level directory of the current directory, with ".." Reference
Absolute path: The directory path, starting with the directory, such as:/users/zhangxueming/downloads
Relative path: The directory path that is computed from the current directory, such as:./downloads
Terminal Operations Command:
Command name + parameter options + command parameters
LS: Displays all files and directories in the current directory
Ls-a: Displays all files and directories in the current directory (including hidden files and directories)
CD + directory path (contains the name of the directory): Enter the directory to the specified path to operate
Hit the CD directly back to the current user directory
PWD: Displays the absolute path of the current operating directory
mkdir: Creating a Directory
mkdir + directory path (the name of the new directory)
RM + Path to file or directory: Delete directory or file
RM-RF + path to file or directory
Path to touch + file (including file name): Create file
TAB: Command completion
MV + src + DST: Move files or directories (modify the name of the directory or file)
cp+-RF + src + DST: Copy the source file or directory to the specified directory
Cat + file path: Display file contents
VIM: The tool for editing text has three modes of operation: Command mode edit mode and visual mode
Command mode: First tap SHIFT +: Then hit command: Set number displays line numbers
To enter edit mode from command mode:
A: The next byte of the current cursor inserts text
I: Insert text in a byte before the current cursor
O: Insert text on the next line of the current cursor
O: Insert text on the previous line of the current cursor
To exit from edit mode to command mode:
Press ESC
In command mode, press X to delete the character specified by the current cursor, and press U to undo the action
DD means delete row (XDD) to delete multiple rows
yy means copying a row (XYY) copies multiple lines
Press P to paste
Move the cursor in vim with the keyboard, not with the mouse
: Wq Save current edits exit
: q! Do not save exit
: W Save Current edits
GCC tools use
Gcc-o executable file name +. C File: Compile. c File Build Executable
./+ executable file name: Execute executable
#include <stdio.h>
Command + A: Check all
Command + R: Run the program
Command + Z: Undo
SHIFT + COMMAND + Z: anti-undo
Control + F: Forward one byte
Control + B: Back one byte
Control + P: Back row
Control + N: Go down one line
Control + E: Move to end of line
Control + A: Move to the beginning of the line
Command +/: Comment Code, uncomment
//
Main function notation:
C99 Standard notation
int main (int argc, const char * argv[])
//{
return 0;
//}
C89 notation
//
int main (void)
//{
printf ("Hello world!\n");
return 0;
//}
Compiler: C language program converted into binary executable program
There can be only one main function in a project
int main (int argc,const char *argv[])
{
#if 0
printf ("Welcome \ n");
printf ("Welcome \ n");
printf ("Welcome \ n");
#endif
printf ("Welcome \ n");
printf ("Welcome \ n");
return 0;
}
Annotation methods
Method One:
//
Method Two:
/* */
Ios-c_day1___mac/xcode Simple Operation command