随笔分类 -  c++

1 2 下一页

c程序实现一道简单的算法题
摘要:在别人博客看到这样一道题: 有足够的1分 ,2分,5分硬币 , 请问有多少种方法拼出1快 我的思路: 从需要多少个硬币想起 , 如果全用5分的, 需要20个 全用1分的,需要100个 就是说 , 不管有多少种方法,需要的硬币数最多100,最少20 设需要 5分硬币数量为x , 2分为y, 1分为z 阅读全文

posted @ 2018-03-19 09:47 齐文宣 阅读(495) 评论(0) 推荐(0)

帮别人做作业, 用c语言实现一个字符stack
摘要:程序要实现的效果如下图 实现代码: 要点 : 用 realloc 函数重新分配数组大小 读取单个字符时, 注意前面加空格 scanf(" %d", &iUserChoice); 编译方法 : Linux : gcc -o Source Source.c windows : cl Source.c 阅读全文

posted @ 2018-03-15 12:35 齐文宣 阅读(434) 评论(0) 推荐(0)

c程序scanf 数字或者字符的问题
摘要:要在前面加一个空格 , 写作 或者 原因见 : https://gsamaras.wordpress.com/code/caution-when-reading-char-with-scanf-c/ 阅读全文

posted @ 2018-03-15 09:57 齐文宣 阅读(592) 评论(0) 推荐(0)

数30的小程序
摘要:规则如下: 从1开始,双方轮流, 每次最多数3个数,先数到最后一个数算输 程序代码: 运行界面: 先问数多少个数, 然后问每次最多数几个数, 这个只能写3,还不支持其他的数, 再问是不是数到最后一个算输,这里也只能填y 然后程序正式开始, 数字之间以空格分隔, 回车结束输入 。 阅读全文

posted @ 2018-01-19 15:01 齐文宣 阅读(407) 评论(0) 推荐(0)

优秀技术文章转载备份 --- 变速原理
摘要:转载:注:为节省篇幅,本文对一些计算机术语直接使用而没有作详细的解释,读者若有不熟悉之处,建议参考清华大学出版社出版,周明德编著的《微型计算机系统原理及应用》一书中关于8253/8254定时器和x86保护模式的相应章节。也许是我孤陋寡闻吧,说出来不怕您笑话,对于“变速齿轮”这样著名的软件,我一直到五 阅读全文

posted @ 2017-08-22 15:25 齐文宣 阅读(463) 评论(0) 推荐(0)

用 c 调用 win-api 实现自动点击c# winform 程序 的按钮
摘要:c# 程序界面 要点击的按钮是 “Start” c程序代码: 功能简介: 首先用 spy++ 确定 c# 程序的 caption 是 WatchDog v1.04 (2010-06-22) 然后用spy++ 找出 button 所在的 hierachy position , 如下图黑线包围的是一个p 阅读全文

posted @ 2017-08-22 14:58 齐文宣 阅读(2167) 评论(0) 推荐(0)

给一个二维数组随机赋值
摘要:运行后, 在 immidiatly 窗口可以查询到 data[0]0x008b6f00 "Gh0stfrAQBcýýýý««««««««þîþîþîþîþ"data[1]0x008b45e8 "Gh0st8Wsa1xýýýý«««««««« 阅读全文

posted @ 2017-04-13 10:08 齐文宣 阅读(517) 评论(0) 推荐(0)

调试console程序时,设置argc and argv
摘要:Result is : 阅读全文

posted @ 2017-04-06 13:04 齐文宣 阅读(253) 评论(0) 推荐(0)

构造函数 explicit 关键字的作用, from stackoverflow
摘要:In C++, the compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use ... 阅读全文

posted @ 2016-01-21 20:52 齐文宣 阅读(192) 评论(0) 推荐(0)

CTBCAFBridge hpp 和 cpp 文件分析
摘要:hpp 文件typedef class CTBCAFBridge *PCTBCAFBridge;class TBCAF_API CTBCAFBridge : public CTBCAFCallFlow{public:/*----------------------------------------... 阅读全文

posted @ 2015-12-29 10:30 齐文宣 阅读(315) 评论(0) 推荐(0)

如何编译调试 ogre tutorial 程序 . 1.8.1 版本
摘要:基类 : BaseApplication.h/*-----------------------------------------------------------------------------Filename: BaseApplication.h-------------------... 阅读全文

posted @ 2015-11-30 10:38 齐文宣 阅读(488) 评论(0) 推荐(0)

windows 8 编译 Ogre 1.8.1 的方法
摘要:1 : 在网站下载名为 : ogre_src_v1-8-1.exe 的7z文件2 : 下载这个 dependencies 文件, 注意不要下载 precompile 的Dependencies Source Repository with CMake build system 29 Septembe... 阅读全文

posted @ 2015-11-27 16:47 齐文宣 阅读(228) 评论(0) 推荐(0)

c++生成随机数
摘要:#include #include #include void main(){ int min = 10; int max = 30; srand ( time(NULL) ); int output = min + (rand() % (int)(max - min + ... 阅读全文

posted @ 2015-04-28 09:11 齐文宣 阅读(180) 评论(0) 推荐(0)

怎样在visual studio 2005 让客户端的recv函数不阻塞
摘要:1 客户端要达到的要求,大致如下 :while(1){if (有需要向服务器发送的request) send()else if(没有需要向服务器发送的request) iResult = recv(mThreadSocket, buffer, 1, MSG_PEEK); //看一下是不是从服务器... 阅读全文

posted @ 2015-04-16 15:00 齐文宣 阅读(515) 评论(0) 推荐(0)

MiniDump类笔记
摘要:h文件 :#pragma once#include #include #include #include class CMiniDump{public: static BOOL Begin(VOID); //声明成静态函数是想直接调用而不必new一个实例 s... 阅读全文

posted @ 2015-02-05 17:57 齐文宣 阅读(367) 评论(0) 推荐(0)

把 AfxBeginThread 用 CreateThread 代替
摘要:原来的代码:线程函数 ---UINT ServerRecThread(LPVOID pParam){ SOCKET sRecSocket = (SOCKET)pParam; while(1) { if(CServerObj.RecClient(sRecSoc... 阅读全文

posted @ 2015-01-20 14:23 齐文宣 阅读(329) 评论(0) 推荐(0)

多个 additional include directories 的复制方法
摘要:如果某个大项目的 additional include directories 很多 , 想仿照此项目新建一个工程时 , 不必一个个的手动添加include 路径可以 用写字板打开项目文件 , 复制关于 additional include directories 部分到新项目 。 阅读全文

posted @ 2014-09-19 10:31 齐文宣 阅读(568) 评论(0) 推荐(0)

怎样在编译时不显示警告
摘要:如果不想显示 4996 号 警告加一行: #pragma warning(disable : 4996)放在 cpp 文件 , #include 之前 。 阅读全文

posted @ 2014-09-19 09:43 齐文宣 阅读(830) 评论(0) 推荐(0)

opengGL + glut 实现画几个简单的图元
摘要:功能: when press "c" ------ circle "s" ------ cube with color "t" ------ triaggle "m" ----- cube with texture when press "r" ----- above primitive will rotate around y axis代码 :#include #include #include "FreeImage.h"#include #include #include 阅读全文

posted @ 2014-02-18 09:33 齐文宣 阅读(655) 评论(0) 推荐(0)

使用Template时 typename 关键字的用法
摘要:以下面这个简单的程序为例#include templatestruct EST_TTI_Entry{ float t; CONTAINER::Index i;};int main(){ return 0;}使用 visual studio 2008 编译会提示 1>d:\code\cplusexercise\abouttemplatememberdefaultint\main.cc(7) : error C2146: syntax error : missing ';' before identifier 'i'1>d:\code\cplusexer 阅读全文

posted @ 2013-10-17 15:51 齐文宣 阅读(899) 评论(0) 推荐(0)

1 2 下一页

导航