关于or,and的使用,查资料得知:and相当于then,or相当于else
下面通过举例来理解这两个关键字的使用:
比如:【1】
$isRight or $a=1000;
他与下面这段代码是等价的:
if(isRight==true)
{
}
else
{
$a=1000;
}
【2】
$update and $db_factory=1;
等价于:
if($update=...
分类:
Web程序 时间:
2014-05-10 09:41:00
阅读次数:
452
重载操作符与转换--重载操作符的定义引言: 明智地使用操作符重载可以使类类型的使用像内置类型一样直观!重载操作符的定义 重载操作符是具有特殊名称的函数:保留字operator后接定义的操作符符号。如:Sales_item operator+(const Sales_item &,const Sales_item &);
除了函数调用操作符之外,重载操作符的形参数目(包括成员函数的隐式...
分类:
编程语言 时间:
2014-05-07 07:03:53
阅读次数:
529
虽然多线程的使用可以提高应用程序的性能,但也增加了复杂性。 如果使用线程在同一时间执行几个函数,访问共享资源时必须相应地同步。 一旦应用达到了一定规模,这涉及相当一些工作。 所以要学习Boost.Thread提供同步线程的类。...
分类:
编程语言 时间:
2014-05-06 14:42:40
阅读次数:
329
1.纯代码写对话框HelloWorld创建空Qt工程,添加C++源文件main.cpp需要设置编码以支持中文-----源代码main.cpp----- 1
#include 2 #include 3 #include 4 #include 5 6 int main(int argc, ch...
分类:
编程语言 时间:
2014-05-06 11:37:47
阅读次数:
446
接下来一系列的文章都是学习https://docs.angularjs.org/tutorial的笔记,主要学习的angular-phonecat项目的实现,来介绍angularjs的使用.1.下载angular-phonecat使用git
clone phonecat:git clone --de...
分类:
Web程序 时间:
2014-05-06 11:01:16
阅读次数:
548
1.创建Qt空工程2.添加Qt设计师界面,无按钮对话框helloqt.ui3.编辑界面,添加部件,修改对话框对象名为HelloQt
1 2 3 HelloQt 4 5 6 7 0 8 0 9 40010 30011 12 13 1...
分类:
编程语言 时间:
2014-05-06 10:55:54
阅读次数:
328
1.新建空Qt工程2.新建C++类HelloQt3.新建ui文件,添加部件,重命名主窗体(对话框)类名HelloQt,构建生成ui头文件4.修改头文件helloqt.h
1 #ifndef HELLOQT_H 2 #define HELLOQT_H 3 4 #include 5 6 names...
分类:
编程语言 时间:
2014-05-06 10:49:09
阅读次数:
447
1.直接使用QObject::trUtf8("中文字符串")2.头文件QTextCodec::setCodecForTr(QTextCodec::codecForName("utf-8"));QObject::tr("中文字符串")3.头文件QTextCodec::setCodecForCStrin...
分类:
编程语言 时间:
2014-05-06 10:43:40
阅读次数:
264
模态对话框-----源文件main.cpp(工程QtDialog)----- 1 #include
"qtdialog.h" 2 #include 3 #include 4 5 int main(int argc, char *argv[]) 6 { 7
QApplication ap...
分类:
编程语言 时间:
2014-05-06 10:41:05
阅读次数:
456
1 #include 2 int main(int argc, char * argv[])
3 { 4 QApplication app(argc, argv); 5
QTextCodec::setCodecForCStrings(QTextCodec::codecForName...
分类:
编程语言 时间:
2014-05-06 10:38:14
阅读次数:
341