class Solution {public: int
lengthOfLastWord(const char *s) { if (s == NULL) return 0; int mlen = 0, len =
0; bool inword = fa...
分类:
其他好文 时间:
2014-06-29 14:13:37
阅读次数:
229
time_t time(time_t
*t);如果t是空指针,直接返回当前时间。如果t不是空指针,返回当前时间的同时,将返回值赋予t指向的内存空间。函数: ctime功 能:
把日期和时间转换为字符串用 法: char *ctime(const time_t *time);#include#incl...
分类:
其他好文 时间:
2014-06-07 06:01:02
阅读次数:
169
Stack 一个简单确很有用的数据结构:FILOpackage Stackimport (
"errors" "fmt")const ( defaultLength=100)type Stack struct{ top int size int
element [...
分类:
其他好文 时间:
2014-06-07 05:14:42
阅读次数:
211
memcpy函数的功能是从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中,返回dest所指内存地址的起始位置。#include
#include #include void* Memcpy(void *dst, const void *src, size_t...
分类:
其他好文 时间:
2014-06-07 05:11:25
阅读次数:
221
memcpy() 的解释:void* memcpy(void* dst, const void*
src, size_t n);// if copying takes place between objects that overlap, the
behavior is undefined.因此自己...
分类:
其他好文 时间:
2014-06-07 04:35:21
阅读次数:
551
#include #include #include #include #pragma
comment(lib, "OpenCL.lib")const char * loadfile(const char * fileName){
std::ifstream fs(fileName, std...
分类:
其他好文 时间:
2014-05-29 00:21:15
阅读次数:
246
拷贝构造函数,是一种特殊的构造函数,它由编译器调用来完成一些基于同一类的其他对象的构建及初始化。其唯一的形参必须是引用,但并不限制为const,一般普遍的会加上const限制。此函数经常用在函数调用时用户定义类型的值传递及返回。拷贝构造函数要调用基类的拷贝构造函数和成员函数。如果可以的话,它将用常量...
分类:
其他好文 时间:
2014-05-29 00:01:47
阅读次数:
378
boolhandle(constosgGA::GUIEventAdapter& ea,
osgGA::GUIActionAdapter& aa){osgViewer::Viewer* viewer
=dynamic_cast(&aa);}bool ControlMan::handle(const o...
分类:
其他好文 时间:
2014-05-28 21:26:06
阅读次数:
670
1 #include 2 3 /*从一个图象文件中生成 GdkPixbuf 类型数据*/ 4
GdkPixbuf * create_pixbuf(const gchar *filename) 5 { 6 GdkPixbuf *pixbuf; 7
GError *error = ...
分类:
其他好文 时间:
2014-05-28 21:24:02
阅读次数:
289
const 常量
1.在定义时必须被初始值,2.前面不加任何修饰符3.变量名字母一般都大写4.常量可以被子类继承5.一个常量是属于一个类的,而不是某个对象的作用:当某些值是固定不变的,就用const1.const
定义的常量和define()定义的常量的区别?希望一个成员变量不被修改 例如圆周率 3...
分类:
Web程序 时间:
2014-05-28 00:50:10
阅读次数:
371