- 博客(46)
- 收藏
- 关注
翻译 scanf的正则表达式
// scanf正则表达式.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){char str[100]={0};//scanf("%s",str);//空格当做
2016-09-02 20:32:16 5485 3
翻译 输入输出小节
// 输入输出小节.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int main1(int argc, char* argv[]){puts("Content_type:text/html\n\n");
2016-08-26 21:06:24 412
翻译 C语言位运算
#include // & //11 1 //01 0//10 0//00 0// 1001 0011 // 1111 0000// 1001 0000//&无论是0还是1 和0相&结果就为0//无论是1还是0 和1相&结果就不变//xxxx xxxx//1111 0111 //那么第五个就一定是0/*
2016-08-26 21:02:39 502
翻译 scanf的补充了解
// scanf的补充了解.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){int num=0;printf("%p\n",&num);//scanf("%
2016-08-26 21:00:44 498
翻译 输入输出的返回值
// 输入输出的返回值.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){int num=printf("1234\n"); //纯字符串的时候返回的就是字符个数 汉
2016-08-26 21:00:05 785
翻译 sscanf数据挖取
// scanf的拓展.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #include int main(int argc, char* argv[]){char name[10];long long IDcard=
2016-08-23 21:24:41 395
翻译 printf的初步了解
// printf的初步了解.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int main1(int argc, char* argv[]){printf("hello world\n");//打印的是字符
2016-08-21 20:58:59 658
翻译 printf补充
// printf补充.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main0(int argc, char* argv[]){{unsigned short int unum=65535;//unsi
2016-08-21 20:58:32 269
翻译 逻辑运算符
// 逻辑运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include /* #define height 188#define money 173000#define handsome 96#define hheig
2016-08-16 22:04:42 278
翻译 自增自减运算符
// 自增自减运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){int a=10;a++; //单独的一行就是为了让变量自增1printf("%d\n
2016-08-16 22:04:16 439
翻译 三目运算符
// 三目运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int main1(int argc, char* argv[]){1?system("calc"):system("notep
2016-08-16 22:03:35 277
翻译 关系表达式
// 关系表达式.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #define sroceline 80int main1(int argc, char* argv[]){int num;
2016-08-16 22:01:17 347
翻译 赋值运算符
// 赋值运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){int a=5;a=3;int b;int c;printf("\n%d"
2016-08-16 21:59:44 213
翻译 逗号运算符
// 逗号运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include //优先级最低的就是逗号运算符int main(int argc, char* argv[]){int a=(1,2);printf("
2016-08-16 21:58:40 258
翻译 运算符操作数与结合性
// 运算符操作数结合性优先级.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //1.理解运算符 操作数 表达式int main1(int argc, char* argv[]){//3+5 3+(2*5) 都为表达式
2016-08-14 21:45:16 452
翻译 算数运算符
// 算数运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){printf("\n%d",+ 3);//这里+就是正号并且空格要被忽略printf("\n%
2016-08-14 21:43:33 290
翻译 数据类型转换的内存原理
// 数据类型转换的内存原理.cpp : Defines the entry point for the console application.////1个字节就为8位十六进制#include "stdafx.h"#include #include /*低字节往高字节 按符号位去填充*/int main1(int argc, char* argv[])
2016-08-14 21:42:59 1108
翻译 数据类型的转换
// 数据类型的转换.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){printf("%d\n",12.1); //数据解析不正确导致数据有误//printf不
2016-08-14 21:42:07 282
翻译 整数
// 整数.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){int a1=10; //十进制的10int a2=010;//八进制的10也就是十进制的8in
2016-08-12 21:31:18 274
翻译 实数
// 实数.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main1(int argc, char* argv[]){float fl=10.5; //赋值号可以自动进行类型转换printf("%f\n",fl);
2016-08-12 21:30:14 289
翻译 float与double的MAX-MIN
#include "stdafx.h"#include #include //浮点数的极大值与极小值在float.h#include //整数形的极大值与极小值在limits.hvoid floatmaxmin(); //函数声明void doublemaxmin();//函数声明void floatmaxmin(){//floatmax =2*2
2016-08-11 21:28:36 4303
翻译 float与double内存中的表示
// float与double内存.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //0 01111110 10000000000000000000000//0011 1111 0100 0000 0000 0000 0000 000
2016-08-11 20:48:10 2319
翻译 关于小数点四舍五入
// 偷窃.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include //#include int _tmain(int argc, _TCHAR* argv[]){double money;while(-1){scanf("%lf",&money);//12.56 125.6+0
2016-08-09 22:09:57 406
翻译 三目运算符
// 三目.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include int _tmain1(int argc, _TCHAR* argv[]){//1?system("calc"):system("notepad");//-1?system("calc"):system("notepad");//第一表达式
2016-08-09 21:56:12 285
转载 浮点数的误差
// 浮点数的误差.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include void aboutfloat();//实数有无后缀void aboubtfloatcompare();//浮点数的比较void aboutdoub
2016-08-01 22:04:14 426
翻译 C语言bool变量
// bool变量.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //技术面试得分#define skillsorce 91 //技术面试分数线#define borderline 90//综合面
2016-08-01 20:49:33 545
翻译 char short 类型的提升
// char和short的类型提升.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main(int argc, char* argv[]){printf("%d\n",sizeof('A'));//VC6中一
2016-08-01 20:20:02 323
翻译 long long 类型
// long long类型.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include //保存整数类型的极大值极小值int _tmain(int argc, _TCHAR* argv[]){int phone=13298314626;char str[256];_itoa(phon
2016-08-01 15:50:24 733
翻译 C语言进制问题
// C语言进制问题.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int main1(int argc, char* argv[]){//十进制转换二进制int decimal;scanf("%d",&de
2016-07-30 20:00:08 379
翻译 sizeof运算符(注:不是函数)
// sizeof运算符.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int main(int argc, char* argv[]){printf("%d\n",sizeof(char));
2016-07-29 21:01:31 338
翻译 #define
// define.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #define ___ "开始" //define相当于将前面定义的替换 遇到string就给替换#define _ main // 替换可以使得代码混
2016-07-29 21:00:18 278
翻译 C语言字符
#include "stdafx.h"#include int main1(int argc, char* argv[]){//charputchar('h'); // ''输出字符的putchar('e');putchar('l');putchar('l');putchar('o');putchar('w
2016-07-29 20:48:13 433
翻译 强制类型转换
// 强制类型转换.cpp : Defines the entry point for the console application.//lkjh#include "stdafx.h"#include //强制类型转换int main1(int argc, char* argv[]){//int a=10.0f;//隐藏类型转换//printf
2016-07-29 20:45:58 351
翻译 LoadCursor
BOOL CWinappDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) {if(pWnd==this)//this指向这个对话框{HCURSOR Cursor=LoadCursor(::AfxGetInstanceHandle(),(LPCTSTR)IDC_CURSOR1);SetCursor(Cursor
2016-05-04 19:31:47 237
翻译 模式对话框与非模式的对话框
//两种方法: 1:member variablevoid CMyDlg::OnButton1() {/*CAboutDlg aboutdlg;//临时的变量一创建就会消失aboutdlg.Create(IDD_DIALOG1);aboutdlg.ShowWindow(SW_SHOW);*/if(!aboutDlg.GetSafeHwnd())aboutDlg.Crea
2016-05-03 16:24:43 372
翻译 CSockets类重写CSocket
#include #pragma comment (lib,"ws2_32.lib")class CSockets {private:SOCKET m_sock;public:CSockets();virtual ~CSockets();bool Creates( UINT nSocketPort=0,//端口int nSocketType
2016-04-27 22:08:05 378
翻译 sprintf sscanf用法
#include #include #include using namespace std;void main1(){char str[30]={0};int num;char op[30];scanf("%d%s",&num,op);sprintf(str,"for /l %%i in (1,1,%d) do %s",num,op);system(s
2016-04-21 17:04:05 276
翻译 Virtual 虚函数
#include "stdafx.h"#include using namespace std;class CBase{int m_i;public:void ReallFunc(){cout}virtual void VirtualFunc(){cout}};class CDerive:public CBase{
2016-04-19 20:48:47 223
翻译 关于在构造函数初始化列表
#include "stdafx.h"class A{int x;int y;const int z;//必须在初始化列表上初始化int & ref;//必须在初始化列表上初始化public://初始时普通的成员变量是可以在构造函数内赋值的//而const 成员变量必须在初始化列表中赋值/*A():x(0),y(0),z(0),ref(x){
2016-04-17 09:25:54 214
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人