First, the priority level of the operation
Second, the conditional operator (expression 1?) Expression 2: Expression 3)
When the Formula 1 is correct, take the value of the type 2; otherwise, the value of the 3
Three, format characters
1#include <stdio.h>2#include <stdlib.h>3 4 voidMain () {5 intnum;6scanf"%d",&num);7printf"\n%d", num);8printf"\n%ld", num);9printf"\n%10d", num);//10 people on the rightTenprintf"\n%-10d", num);//10-bit on the left Oneprintf"\n%010d", num);//10 digits, left 0 Aprintf"\n%5d", num);//5 bit, more than according to the actual, not more than the right - -System"Pause"); the}
1#include <stdio.h>2#include <stdlib.h>3 4 voidMain () {5 intnum;6 Charstr0[ -],str[ -];7scanf"%d%s",&num,str0);8printf"num=%d,str0=%s", NUM,STR0);9sprintf (str,"for/l%%i in (1,1,%d) do%s", NUM,STR0);Ten system (STR); One ASystem"Pause"); -}
Open 3 Calculators
Iv. cross-permission modification value (injection)
1#include <stdio.h>2#include <windows.h>3 4 voidMain () {5 intx=Ten;6 inty=100000;7printf"%x,%x",&x,&y);8 while(1){9printf"There's%d chicks, there's%d bucks.", x, y);TenSleep ( +); One } A}
According to the address, write code, generate DLL files, inject
1 void Go () {2 int *p= (int *)0X4DFCBC; 3 int *q; 4 *p=0; 5 q= (int *)0x4dfcb0; 6 *q=; 7 }
Five, String assignment
1#include <stdio.h>2#include <stdlib.h>3 4 voidMain () {5 Charstr[ -],strurl[ -];6scanf"%s", str);7sprintf (strURL,"%s", str);//implements the assignment of a string because the string cannot be assigned by Str=strurl8sprintf (strURL,"%.7s", str);//Intercept the first 7 characters9sprintf (strURL,"%10.7s", str);//10 bits wide, intercept the first 7 charactersTen system (strURL); OneSystem"Pause"); A}
Programming Road (9), Operation priority