- 博客(0)
- 资源 (5)
空空如也
c++运算符优先级
c++运算符优先级
优先级 操作符 描述 例子 结合性
1 ()
[]
->
.
::
++
-- 调节优先级的括号操作符
数组下标访问操作符
通过指向对象的指针访问成员的操作符
通过对象本身访问成员的操作符
作用域操作符
后置自增操作符
后置自减操作符 (a + b) / 4;
array[4] = 2;
ptr->age = 34;
obj.age = 34;
Class::age = 2;
for( i = 0; i 0; i-- ) ... 从左到右
2 !
~
++
--
-
+
*
&
(type)
sizeof
逻辑取反操作符
按位取反(按位取补)
前置自增操作符
前置自减操作符
一元取负操作符
一元取正操作符
解引用操作符
取地址操作符
类型转换操作符
返回对象占用的字节数操作符 if( !done ) ...
flags = ~flags;
for( i = 0; i 0; --i ) ...
int i = -1;
int i = +1;
data = *ptr;
address = &obj;
int i = (int) floatNum;
int size = sizeof(floatNum); 从右到左
2014-08-01
C#屏蔽Windows快捷键及任务管理器
C#屏蔽Windows快捷键及任务管理器
public delegate int HookProc(int nCode, int wParam, IntPtr lParam);
private static int hHook = 0;
public const int WH_KEYBOARD_LL = 13;
//LowLevel键盘截获,如果是WH_KEYBOARD=2,并不能对系统键盘截取,会在你截取之前获得键盘。
private static HookProc KeyBoardHookProcedure;
//键盘Hook结构函数
[StructLayout(LayoutKind.Sequential)]
public class KeyBoardHookStruct
{
public int vkCode;
public int scanCode;
public int flags;
public int time;
public int dwExtraInfo;
}
//设置钩子
[DllImport("user32.dll")]
public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
//抽掉钩子
public static extern bool UnhookWindowsHookEx(int idHook);
[DllImport("user32.dll")]
//调用下一个钩子
public static extern int CallNextHookEx(int idHook, int nCode, int wParam, IntPtr lParam);
[DllImport("kernel32.dll")]
public static extern int GetCurrentThreadId();
2014-08-01
搜索局域网内IPCamera设备
搜索局域网内IPCamera设备
public Receiver()
{
_thread = new Thread(
delegate()
{
// Create the client UDP socket. Listing on port 9003
IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, 9003);
UdpClient client = new UdpClient(endPoint);
// Receive the packets asynchronously.
client.BeginReceive(
new AsyncCallback(OnPacketReceived),
new UdpState() { Client = client, EndPoint = endPoint });
// Wait for the thread to end.
_shutdownThread.WaitOne();
}
);
}
2014-08-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人