简介
MFC(Microsoft Foundation Classes) 微软基础类库。 
 MFC 还提供了一个应用程序框架,例如应用程序导和类向导自动生成的代码,大大减少了软件开发者的工作量,提高了开发效率。
学习环境: VC++6.0
第一个控制台程序

点组件-全部重建, 编译,执行 
输入数字计算
// First.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
    printf("input numbers !\n");
    int a,b;
    scanf("%d %d", &a, &b);
    printf("%d + %d= %d \n", a,b,a+b);
    return 0;
}
全局变量与全局函数
#include "stdafx.h"
#include <stdio.h>
int g_nTet = 32;
int g_nT2 = 11;
void Test(){
    int a,b;
    scanf("%d %d", &a, &b);
    printf("%d + %d= %d \n", a,b,a+b);
}
int main(int argc, char* argv[])
{
    printf("input numbers !\n");
    Test();
    return 0;
}
结构体
成员变量默认是公有的
struct SInfo
{
    int nNumber;
    char sName[20];
    float fSalary;
}
类
成员变量默认是私有的
#include "stdafx.h"
#include <stdio.h>
int g_nTet = 32;
int g_nT2 = 11;
struct SInfo
{
    int nNumber;
    char sName[20];
    float fSalary;
};
class CTest{
public:
    int a,b;
    char sName[20];
    void Display(){
        printf("a=%d,b=%d,Name=%s",a,b,sName);
    }
};
void Test(){
    int a,b;
    scanf("%d %d", &a, &b);
    printf("%d + %d= %d \n", a,b,a+b);
}
int main(int argc, char* argv[])
{
    printf("input numbers !\n");
    Test();
    return 0;
}
代码格式设置

 设置: 
 - Number 红色 
 - String 紫色
清除输入缓存与switch分支语句
// First.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
int g_nT2 = 11;
void Test()
{
    int a,b;
    char c;
    const int t=10;
    scanf("%d %d",&a,&b);
    printf("请输入运算符号:[+、-、*、/]");
    //输入缓存的清理
    fflush(stdin);
    scanf("%c",&c);
    int nRet = 0;
    switch(c)
    {
    case '+':
        nRet = a+b;
        break;
    case '-':
        nRet = a-b;
        break;
    case '*':
        nRet= a*b;
        break;
    case '/':
        nRet = a/b;
        break;
    }
    printf("运行结果:%d%c%d=%d\n",a,c,b,nRet);
}
int main(int argc,char* argv[])
{
    g_nT2 = 122;
    Test();
    return 0;
}                
                










