欢迎关注我的推特
摘要: #include <windows.h>#include <tchar.h> #include <stdio.h> int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...){ TCHAR szBuffer [1024] ; va_list pArgList ; // The va_start macro (defined in STDARG.H) is usually equivalent to: // pArgList = (char *... 阅读全文
posted @ 2012-11-28 13:21 服务号AwesomeAITools 阅读(228) 评论(0) 推荐(0)
摘要: #include <windows.h>int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow){ MessageBox (NULL, TEXT ("Hello, World!"), TEXT ("HelloMsg"), 0) ;//0为OK return 0 ;} 阅读全文
posted @ 2012-11-28 09:56 服务号AwesomeAITools 阅读(195) 评论(0) 推荐(0)
摘要: C/C++都区分大小写注释不会增加程序的大小符号常量可提高程序的可读性 const float PI=3.1415926;当“/”用于两个整型数据相除时,结果只取商的整数部分,如:1/2=0赋值运算符:自右而左 如a=b=c=5逗号表达式“表达式1,表达式2”//先求1,再求2,结果为表达式2的值条件表达式 表达式1?表达式2:表达式3//2和3可以是任何类型,且类型可以不同,结果为二者中较高的类型;先求1,若为真(非0),则求2,若为假,则求3;多个嵌套时,自右而左cout<<(score>=60?”pass”:”fail”);强制类型转换:c中为(int)a;而C++中为 阅读全文
posted @ 2012-11-22 23:22 服务号AwesomeAITools 阅读(313) 评论(0) 推荐(0)
摘要: 编译时要加上-g,才能用gdb调试list(l)列出源代码:list 1 //从第一行开始列出源代码start开始,next(n)一条条执行step(s)进入函数在函数中:bt查看堆栈 查看局部变量的值i locals显示变量的值 print(p) 如p sumfinish执行完当前函数修改sum变量的值set var sum = 0退出quit 阅读全文
posted @ 2012-11-22 12:31 服务号AwesomeAITools 阅读(232) 评论(0) 推荐(0)
摘要: #include <boost/lexical_cast.hpp>#include <iostream>using namespace boost;using namespace std;int main(){ int x = lexical_cast<int>("100"); long y = lexical_cast<long>("2000"); float pi = lexical_cast<float>("3.14159e5"); double e = lexical 阅读全文
posted @ 2012-11-21 18:37 服务号AwesomeAITools 阅读(355) 评论(0) 推荐(0)
摘要: #include <boost/utility.hpp>class no_copy : boost::noncopyable //默认私有继承{}; 阅读全文
posted @ 2012-11-21 18:28 服务号AwesomeAITools 阅读(302) 评论(0) 推荐(0)
摘要: BETWEEN在 WHERE 子句中使用,用来选取两个值之间的数据。这些值可以是数值、文本或者日期。语法SELECT 列FROM 表WHERE 列BETWEEN value1 AND value2表:IdLastNameFirstNameAddressCity1AdamsJohnOxford StreetLondon2BushGeorgeFifth AvenueNew York3CarterThomasChangan StreetBeijing4GatesBillXuanwumen 10Beijing例现在需要以字母顺序显示介于 "Adams"(包括)和 "Car 阅读全文
posted @ 2012-11-15 18:54 服务号AwesomeAITools 阅读(301) 评论(0) 推荐(0)
摘要: 用vi新建一个文件:vi test.c状态栏中的18C表示有18个字符按i进入编辑模式,按ESC回到默认模式按下:后再输入wq存盘退出;强制写入:wq!一般模式下:(注意大小写)方向键移动光标;翻页Page Down/UPHome:一行最前; End一行最后G:移到最后一行, 20G移到第20行(可先设立行号),向右移动40个字符:40→gg:移到第一行;n<Enter>:光标向下移动n行搜索:/word 从光标处向下搜索,n向下继续搜索下一个?word 从光标处向上搜索,N向上继续搜索下一个:1,$s/word1/word2/g 将word1替换为word2,在g后面加c表示弹出 阅读全文
posted @ 2012-11-13 11:02 服务号AwesomeAITools 阅读(300) 评论(0) 推荐(0)
摘要: 第一题:输入实数x,按下列公式计算并输出x和y的值(保留两位小数)答案:#include <math.h>#include <stdio.h>int main(){ float x, y; scanf("%f", &x); if (x <= 0) { y = sin(x); } else if (x <= 10) { y = x*x + 1; } else { y= 1.0/(x*x*x + x*x + 1); } printf("x = %.2f,y = %.2f\n", x... 阅读全文
posted @ 2012-11-12 22:40 服务号AwesomeAITools 阅读(807) 评论(0) 推荐(0)
摘要: 加载中... 阅读全文
posted @ 2012-11-12 22:36 服务号AwesomeAITools 阅读(155) 评论(0) 推荐(0)