摘要:http://www.chinavideo.org/forum.php?mod=viewthread&tid=12163
阅读全文
摘要:1、继承动物有 吃 睡 呼吸的方法 当然 鱼也有 不用重复再定义 1)public 那里都可以访问 1 #include 2 class Animal //类 基类 3 { 4 public: 5 void eat()//吃方法 6 { 7 cout 2 class Animal //类 基类 3 { 4 public: 5 void eat()//吃方法 6 { 7 cout 2 class Animal //类 基类 3 { 4 public: 5 void eat()//吃方法 6 { 7 cout 2 clas...
阅读全文
摘要:0、vc++6.0 工程---win32控制台程序 文件---c++1、建立结构体 1 #include 2 struct Point 3 { 4 5 int x; 6 int y; 7 }; 8 9 void main ()10 {11 Point pt;12 pt.x=5;13 pt.y=5;14 //cout 2 struct Point 3 { 4 public: 5 int x; 6 int y; 7 void output () 8 { 9 cout 2 //struct Point 3 class Poin...
阅读全文
摘要:#include <stdio.h> #include <windows.h> char buffer[100] = { 'x' , 'y' , 'z' }; int W_A=0,R_A=0;//子线程函数 1 DWORD WINAPI ThreadFun1(LPVOID pM) { while (1) { //printf("子线程的线程1 "); // R_buffer[]={0,1,2,3,4,5,6,7,8,9};// buffer }return 0; } //子线程函数 2DWORD WIN
阅读全文
摘要:#include <stdio.h>#include <time.h>int main (){ FILE * pFile;int i;pFile = fopen ( "myfile.txt" , "wb" );char buffer[8*1024] = {0};double d ;clock_t start=0;clock_t finish=0; int j=0;start = clock(); //计时开始for (j=0;j<9200;j++){ for(i=0;i<8*1024;i++) buffer[i]=i;
阅读全文
摘要://最简单的创建多线程实例 #include <stdio.h> #include <windows.h> //子线程函数 1 DWORD WINAPI ThreadFun1(LPVOID pM) { while (1){printf("子线程的线程1 ");return 0; } } //子线程函数 2int i=0;DWORD WINAPI ThreadFun2(LPVOID pM) { FILE *fp;char buffer[] = { 'x' , 'y' , 'z' }; i=i+3;prin
阅读全文
摘要:转:-------http://sunnysab.blog.163.com/blog/static/18037500920128113618804/多线程可以给程序实现许多的功能,并且多个函数同时进行有效地提高了程序的运行效率。这篇文章讲的就是VC控制台下的多线程操作。本文章还得感谢《VC+API常用函数简单例子大全》的作者http://hi.baidu.com/3582077/home,该书下载地址(点击这里)。 首先我们要用到CreateThread函数,以下是函数原型: HANDLE CreateThread( LPSECURITY_ATTR...
阅读全文