摘要:
1. 实现非ui线程更新ui线程的代码2. 编码中出现的一个错误及探究<1>. 实现非ui线程更新ui线程之前的基本做法是使用Invoke实现,这里采用的是 .net 4.0中的Task来实现,代码如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Thr 阅读全文
posted @ 2011-04-19 19:59
qiang.xu
阅读(1605)
评论(0)
推荐(0)
摘要:
1. io操作实例2. io函数分析<1>. io 操作实例1.1 文本文件读取#include <stdio.h> // file io operators#include <stdlib.h>int main(int argc, char* argv[]){ FILE* fp; int ch; long int count = 0; if (argc != 2) { printf("usage : %s filename", argv[0]); return EXIT_SUCCESS; } // open file if ( (fp 阅读全文
posted @ 2011-04-19 16:27
qiang.xu
阅读(2361)
评论(0)
推荐(1)
摘要:
1. 副作用和顺序点2. 输出输出缓冲区3. 变量的声明和变量定义4. 函数指针5. const和define6. 存储类,链接和内存管理<1>. 副作用side effect和顺序点sequence point;1.1 side effect和sequence point对于下面的语句state = 10;我们认为这是一个表达式(赋值语句在c语言中是表达式),表达式的值即是10,那么从何而来副作用?我们说c语言对于state = 10;的处理仅仅是想得到该语句的值,但是在计算该表达式值的过程中无意将state变量的值改变掉了,这既是所谓的side effect。有了side ef 阅读全文
posted @ 2011-04-19 14:40
qiang.xu
阅读(820)
评论(0)
推荐(1)