printf

Want to know printf? we have a huge selection of printf information on alibabacloud.com

Learn point C language (21): Data type

1. Get the address of the array no, because the array name itself is an address #include  int main(void) {   char c = 'A';   char cs[] = "ABC";   printf("%c,%s\n",c,cs);      /* 获取字符及字符数组的内容 */   

Learn point C language (20): Data type

1. Variable addresses can be obtained through & variables: #include  int main(void) {   int num = 10;   printf("变量值: %d\n",num);   printf("变量址: %d\n",&num);   getchar();   return 0; } 2. A variable that represents a variable address is a

Learn point C language (19): Data type

1. The logo of the array is []: #include  int main(void) {   int nums[3];   nums[0] = 11;   nums[1] = 22;   nums[2] = 33;   printf("%d,%d,%d",nums[0],nums[1],nums[2]);   getchar();   return 0; } 2. Size and dimensions of the array: #include 

Learn point C language (18): Data type

1. Printf enumeration to display the ordinal of an enumeration: #include  int main(void) {   enum ABC{AAA,BBB,CCC};   enum ABC e1,e2,e3;   e1 = AAA;   e2 = BBB;   e3 = CCC;   printf("%d, %d, %d\n", e1, e2, e3);   getchar();   return 0; } 2.

Learn point C language (17): Data type

1. The result of the operation exceeds the type size: #include  #include  int main(void) {   short s1 = SHRT_MAX;   short s2 = SHRT_MAX;   short num1;   int num2;   /* 不会是期望的值 */   num1 = s1 + s2;   printf("%d\n",num1);   /* 这样可以了 */   num2 = s1 

Learn point C language (16): Data type

曾经对float num=3.14f; 这样的赋值非常疑惑,其实现在也不明白. 既然说明了是float类型,又何必在3.14后面挂个f呢? 书上说: int num=100; 一个整数常量将默认为int类型(除非常数有后缀或超出了int的范围) double num=3.14; 一个浮点数常量将默认为double类型 并要求: long num=100L; long long num=100LL; unsigned long=100UL; unsigned long long num=100

Learn point C language (15): Data type

The variable that gets the type size is best not the int type, but the size_t type; size_t are defined in stdio.h and stddef.h. 1. Get the size of a known type: #include #include int main (void){char n = 2;size_t size; size = sizeof

Learn point C language (14): Data type

In the C language, the char type is always a byte, and the Double-byte character type is wchar_t; But it is not a built-in type, defined in Stddef.h. Assign a value to a character or character array (that is, a string) of type wchar_t to be

Learn point C language (13): Data type

整型int可添加short和long: short int:简为short; long int: 简为long; long long int: 简为long long 它们都可以再添加 unsigned: unsigned int:      简为unsigned unsigned short int:   简为unsigned short unsigned long int:   简为unsigned long unsigned long long int: 简为unsigned long 

Learn point C language (12): Data type

C Language Data type: Basic type, constructed type, pointer type, empty type. Basic types include: integer, character, floating-point (single, double), enumeration. The constructed types also include: arrays, structs, and common bodies. 1.

Learn point C language (one): Goto statement

Example 1: #include  #include  int main(void) {   char str[256];   scanf("%s", str);   if (strlen(str)      goto Label1;   } else {     goto Label2;   }   Label1:     printf("\n输入内容没有超过10个字符");     goto Label3;   Label2:

Learn point C language: switch statement

1. General: #include  int main(void) {   int i;   for (i = 0; i      switch (i) {       case 1:         printf("%d\n", i);         break;       case 3:         printf("%d\n", i);         break;       case 5:         printf("%d\n", i);

Learn point C language (9): if statement

1. General: #include  int main(void) {   int i;   for (i=0;i     if (i%2==0) printf("%d 是偶数\n", i);      if (i%2!=0) printf("%d 是奇数\n", i);    }   getchar();   return 0; } #include  int main(void) {   int i;   for (i = 0; i      if (i > 4)      

Learn point C language (8): While and do while loops

1. While loop: #include  int main(void) {   int i=0;   while (i     i++;     printf("%d\n", i);   }   getchar();   return 0; } 2. Do While loop: #include  int main(void) {   int i=0;   do   {     i++;     printf("%d\n", i);   } while (i

Learn point C language (7): For loop

1. For the basic form of the loop: #include  int main(void) {   int i;   for (i=0;i      printf("%d\n",i);   }   getchar();   return 0; } 2. Step Size: #include  int main(void) {   int i;   for (i=0;i      printf("%d\n",i);   }   getchar();

Learn point C language (3): Escape character

\n //换行 \r //回车 \b //退格 \f //换页 \t //水平制表符 \v //垂直制表符 \a //响声 \" //双引号 \' //单引号 \x?? //用小写 x 和两位数字(十六进制数)表示一个字符 \??? //用三位数字(八进制)表示一个字符 Example 1: #include  int main(void) {   printf("\"C++Builder\" 2009\n");   printf("\x41");   putchar('\n');

C Language Conditional control statement (ii)

3.if...elseif statement The actual application often faces more choice, at this time, will If...else expands, then obtains the IF...ELSEIF structure, its general form is: if statement 1 else if statement 2 else if

C Language Conditional control statement (i)

In the three basic structures of the program, the second is the choice of structure, its basic characteristics are: The process of the program is composed of multiple branches, in the process of executing a program, according to different

Pointer operators and pointer expressions

6.3.1 pointer operators and pointer expressions There are two operators on pointers in C: & Operator: Takes the address operator, &m is the address of the variable m. * Operator: pointer operator, *PTR represents the variable to which it is

Pointers and Arrays (iii)

Because the function call of C program is called by value, that is, when the actual parameter is combined with the formal parameter, the real arguments value is passed to the formal parameter, so when we use the function to process the array, if we

Related Tags:
Total Pages: 42 1 .... 12 13 14 15 16 .... 42 Go to: Go

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.