1.SetTimer:在控制台应用程序中同样可以用SetTimer实现定时器的效果。
普通的win32程序中定时器的应用很多也很方便,但是在win32控制台中也是可以使用定时器的,利用的是windows程序的消息循环机制,如下:
#include
#include
using namespace std;
//定时器ID
DWORD dwTimerId = 0;
void CALLB...
排列与组合,递归实现
// Permutation and Combination.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#include
using namespace std;
vector>aaa;
set>solu;
void do_once(vector&selected, vector&re...
分类:
其他好文 时间:
2015-08-25 12:06:20
阅读次数:
184
// ACM学习-割点和桥.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#include
#include
using namespace std;
const int v = 13;
int edge[v][v] = {
{ 0, 1, 1, 0, 0, 1, 0, 0, 0, 0...
分类:
其他好文 时间:
2015-08-25 12:01:46
阅读次数:
253
我们经常听到建议要把构造函数不能为虚,析构函数最好为虚,这是为什么?如下例子:// pvtable1.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include using namespace std;class Base1 {public: Base1()...
分类:
其他好文 时间:
2015-08-21 19:05:27
阅读次数:
144
在多重继承里的虚函数表可以在vs里面看到,如下有一个基类就有一张表,可以通过 int** pVtab = (int**)&d; pFun = (Fun)pVtab[0][0];来访问每一个虚函数,如下代码:// pvtable1.cpp : 定义控制台应用程序的入口点。//#includ...
分类:
其他好文 时间:
2015-08-21 18:54:31
阅读次数:
136
1 // 最小的k个数.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 11...
分类:
其他好文 时间:
2015-08-21 18:53:32
阅读次数:
195
开发工具vs2010
1、新建win32控制台应用程序
点击项目属性,选择配置属性为Release,配置类型为静态库
2、Build工程后,在Release模式下找到lib文件...
开发工具 vs2010
1、新建win32控制台应用程序
2、将静态库的头文件包含在程序中并手动链接静态库...
1.新建一个控制台应用程序 TestIOC2.新增一个 IocFactory类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml;using System...
分类:
其他好文 时间:
2015-08-20 15:14:31
阅读次数:
124
// tt.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
class A
{
public:
void fun()
{
printf("1111111111");
}
static void fun2()
{
fun();
}
};
int _tmain(int argc, _TCHAR* argv[])
{
A a;
A:...
分类:
其他好文 时间:
2015-08-19 20:33:09
阅读次数:
135