Xcode basic shortcut keys and several common variables

Source: Internet
Author: User

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

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.