上一页 1 ··· 39 40 41 42 43

2014年10月23日

C++ string char[] 转化

摘要: 可见到string转char[]相当简单,只要呼叫string class的成员函式c_str(),即可将string转为char[]。那么char[]转string呢?有两种方法,第一种是初始string变数时,即把char[]当作参数来初始化,第二种则是使用string class的成员函式as... 阅读全文

posted @ 2014-10-23 18:48 蒂其之死 阅读(243) 评论(0) 推荐(0)

c++ 转化

摘要: atof(将字符串转换成浮点型数)相关函数atoi,atol,strtod,strtol,strtoul表头文件#include定义函数doubleatof(constchar*nptr);函数说明atof()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再遇到... 阅读全文

posted @ 2014-10-23 18:45 蒂其之死 阅读(288) 评论(0) 推荐(0)

c++ stl

摘要: 1.listassign() 给list赋值back() 返回最后一个元素begin() 返回指向第一个元素的迭代器clear() 删除所有元素empty() 如果list是空的则返回trueend() 返回末尾的迭代器erase() 删除一个元素front() 返回第一个元素get_allocat... 阅读全文

posted @ 2014-10-23 18:05 蒂其之死 阅读(182) 评论(0) 推荐(0)

c++ int string互转

摘要: 1. if(i>str;string转intstd::string str = "123";int n = atoi(str.c_str());#include "stdafx.h"#include #include using namespace std;void main(){ //... 阅读全文

posted @ 2014-10-23 18:01 蒂其之死 阅读(222) 评论(0) 推荐(0)

c++ String去除头尾空格

摘要: 1.使用string的find_first_not_of,和find_last_not_of方法 1 #include 2 #include 3 4 std::string& trim(std::string &); 5 6 int main() 7 { 8 std::string... 阅读全文

posted @ 2014-10-23 09:35 蒂其之死 阅读(7530) 评论(0) 推荐(0)

2014年10月21日

hql date比较

摘要: 补充:相等时用to_char,比较大小()时用时间格式(如果不是时间格式可以用to_date)java.util.Datedate=newjava.util.Date();Stringhql="selectifromtableiwhereto_char(i.date,'yyyy-MM-dd')=to... 阅读全文

posted @ 2014-10-21 15:58 蒂其之死 阅读(1680) 评论(0) 推荐(0)

hql Hibernate.gethibernatetemplate()

摘要: 1. find(String hql); //普通查询示例:this.gethibernateTemplate().find("from User");2. find(String hql,Object value);//一个查询条件示例:this.gethibernateTemplate().fi... 阅读全文

posted @ 2014-10-21 15:27 蒂其之死 阅读(471) 评论(0) 推荐(0)

2014年10月20日

sql 查找最后一条记录

摘要: 1.通过rowselect * from tablewhere rownum<(select count(*)+1 from table)minusselect * from tablewhere rownum<(select count(*) from table)也可以简化为select * f... 阅读全文

posted @ 2014-10-20 16:22 蒂其之死 阅读(2729) 评论(0) 推荐(0)

上一页 1 ··· 39 40 41 42 43

导航