上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: 在上一篇博文中介绍了如何实现将整数转换为字符串,这里在介绍一个将字符串转换为整数的实现方法。 1 #include 2 #include 3 4 int isspace(int x); 5 int isspace(int x); 6 int my_atoi(const char *nptr);... 阅读全文
posted @ 2015-07-18 15:43 XiaoManon 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 将一句话里的单词进行倒置,标点符号不倒置。比如一句话:i come from beijing.倒置后变成:beijing. from come i。解析:解决该问题可以分为两步:第一步全盘置换该语句成:.gnijieb morf emoc i。第二步进行部分翻转,如果不是空格,则开始翻转单词。 1 ... 阅读全文
posted @ 2015-07-18 15:41 XiaoManon 阅读(684) 评论(0) 推荐(1) 编辑
摘要: 要求:将一个整型变量转换为给定基数(base)的以空字符结尾的字符串,并将结果保存在指定的数组中。分析:如果允许使用库函数的话,这个很好解决,因为在中存在一个可以将整型转换为字符串的函数,原型如下:char* itoa(int value, char* str, int base)value为待转换... 阅读全文
posted @ 2015-07-17 17:16 XiaoManon 阅读(1736) 评论(0) 推荐(0) 编辑
摘要: QML中的定时器能够周期性的触发一个事件,其使用非常简单、方便。这里给出一个示例: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs 1.2 ... 阅读全文
posted @ 2015-06-02 15:04 XiaoManon 阅读(2650) 评论(0) 推荐(0) 编辑
摘要: QML提供了对应的按键处理方法,我们接下来实现一个通过键盘上的方向键来移动文本,代码如下: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs ... 阅读全文
posted @ 2015-06-02 14:36 XiaoManon 阅读(5254) 评论(0) 推荐(0) 编辑
摘要: QML支持鼠标事件处理,我们可以利用这个来实现一个变色矩形示例,代码如下: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs 1.2 5 6... 阅读全文
posted @ 2015-06-02 14:08 XiaoManon 阅读(1731) 评论(0) 推荐(0) 编辑
摘要: QML中的组件可以重复使用,并且可以通过Loader加载。如下示例: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs 1.2 5 6 Re... 阅读全文
posted @ 2015-06-02 13:59 XiaoManon 阅读(3440) 评论(0) 推荐(0) 编辑
摘要: 鼠标操作使用很多,下面给出一个示例: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs 1.2 5 6 Rectangle{ 7 i... 阅读全文
posted @ 2015-06-01 15:29 XiaoManon 阅读(1750) 评论(0) 推荐(0) 编辑
摘要: 首先看下面一段示例代码: 1 import QtQuick 2.4 2 import QtQuick.Controls 1.3 3 import QtQuick.Window 2.2 4 import QtQuick.Dialogs 1.2 5 6 Rectangle{ 7 id: roo... 阅读全文
posted @ 2015-06-01 14:38 XiaoManon 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 首先定义顺序栈的存储结构 1 /* 栈的顺序存储结构 2 **/ 3 #define STACK_INIT_SIZE 100 //存储空间的初始分配量 4 #define STACK_INCREMENT 10 //存储空间的分配增量 5 typedef int SElemType; 6 typed... 阅读全文
posted @ 2015-05-25 20:34 XiaoManon 阅读(254) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页