易截截图软件、单文件、免安装、纯绿色、仅160KB

C/C++运算符的优先级


Precedence Operator Description Example Overloadable Associativity
1
::
Scope resolution operator
Class::age = 2;
no
none
2
()
()
[]
->
.
++
--
const_cast
dynamic_cast
static_cast
reinterpret_cast
typeid
Function call
Member initalization
Array access
Member access from a pointer
Member access from an object
Post-increment
Post-decrement
Special cast
Special cast
Special cast
Special cast
Runtime type information
isdigit('1')
c_tor(int x, int y) : _x(x), _y(y*10){};
array[4] = 2;
ptr->age = 34;
obj.age = 34;
for( int i = 0; i < 10; i++ ) cout << i;
for( int i = 10; i > 0; i-- ) cout << i;
const_cast<type_to>(type_from);
dynamic_cast<type_to>(type_from);
static_cast<type_to>(type_from);
reinterpret_cast<type_to>(type_from);
cout « typeid(type).name();
yes
yes
yes
yes
no
yes
yes
no
no
no
no
no
left to right
3
!
not
~
compl
++
--
-
+
*
&
new
new []
delete
delete []
(type)
sizeof
Logical negation
Alternate spelling for !
Bitwise complement
Alternate spelling for ~
Pre-increment
Pre-decrement
Unary minus
Unary plus
Dereference
Address of
Dynamic memory allocation
Dynamic memory allocation of array
Deallocating the memory
Deallocating the memory of array
Cast to a given type
Return size of an object or type
if( !done ) …
flags = ~flags;
for( i = 0; i < 10; ++i ) cout << i;
for( i = 10; i > 0; --i ) cout << i;
int i = -1;
int i = +1;
int data = *intPtr;
int *intPtr = &data;
long *pVar = new long;
MyClass *ptr = new MyClass(args);
delete pVar;
delete [] array;
int i = (int) floatNum;\\int size = sizeof(float);
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
right to left
4
->*
.*
Member pointer selector
Member object selector
ptr->*var = 24;
obj.*var = 24;
yes
no
left to right
5
*
/
%
Multiplication
Division
Modulus
int i = 2 * 4;
floa


相关文档:

c学习第一天

n 用标识符代表一个常量,称为符号常量。 n 符号常量与变量不同,它的值在其作用域内不能改变,也不能再被赋值。 n 使用符号常量的好处是: Ø 含义清楚; Ø 能做到“一改全改”。 --话说:不知道c里面有没有全局变量的东东,有的话,这两个的实际用处有啥子区别呢?看看再说 数据结构+算法=程序 终于知道这 ......

求教高手 关于C播放wav问题


最近在网上查了好多关于C播放wav这方面的资料,调试半天也没有结果,搜到一个编译好的EXE文件能播放,没有源代码,反汇编不了,谁能指点一下。。。。。以下两种代码段:
 #include <stdio.h>
#include <dos.h>
/* wav文件结构 */
typedef struct WaveData
{
   unsigned long sample_le ......

linux 系统下使用C程序实现时钟的函数

#include "stdio.h"
#include "math.h"
#include "time.h"
#define INTERVAL 1  定义宏的时间间隔为1秒
//
void On_Time()  //每一秒激发的事件
{
   printf("now=%s\n","JJK"); 
}
void Timer()  //时钟的函数
{  time_t newclk,oldclk;
   while(1)
 &nb ......

直接选择排序 C代码

void StraightSelectionSort(int array[], unsigned int n)
{
/*
注:关键字值类型为int,数组的索引是从0开始
1. 初始状态无序区为array【0, n - 1】,有序区为空。
2. 第1趟排序从array【0, n - 1】中找到下标为k的关键字最小值,把array【k】和
array【0】交换。现在无序区为array【1, n - 1】, 有序区 ......

(c primer plus第五版) 学习笔记

第二章 c语言概述
一个简单的实例
#include <stdio.h>
int main(void)
{
   int num;   /*定义变量num*/
      num = 1;  /*给变量num赋值*/
 
      printf("I am a simple"); /*使用printf()函数*/
   & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号