一、platform总线、设备和驱动 platform是一种虚拟总线,对应的设备称为platform_device,对应的驱动称为platform_driver。platform_device定义在中: 1 struct platform_device { 2 const char ...
分类:
系统相关 时间:
2014-06-23 00:17:01
阅读次数:
385
编写类String 的构造函数、析构函数和赋值函数,已知类String 的原型为:class String{public:String(const char *str = NULL); // 普通构造函数String(const String &other); // 拷贝构造函数~ String(v...
分类:
其他好文 时间:
2014-06-22 23:31:22
阅读次数:
212
如果你经常被飘忽不定的const搞晕乎了,那么欢迎看这里,
const与常量
const与指针
const与成员函数...
分类:
其他好文 时间:
2014-06-22 22:57:24
阅读次数:
289
下面给一个简单示例演示命名空间和自定义头文件的使用,代码如下:
compare.h:
namespace compare{
double max(const double* data,int size);
double min(const double* data,int size);
}
compare.cpp:
#include "compare.h"
double c...
分类:
编程语言 时间:
2014-06-22 20:32:00
阅读次数:
275
#import
#include "Function.h"
int main(int argc, const char * argv[])
{
// printf("%d\n",sum(10, 8));
//
// int (*p)(int x,int y) = sum;
// //函数指针类型 int (*)(int x,int y)
// //描述: 指向 返回值为...
分类:
编程语言 时间:
2014-06-22 18:41:01
阅读次数:
326
f[i]=f[i-1]*p+f[i-2]*(1-p);
正好可以用矩阵加速。。。。
#include
#include
#include
#include
#include
using namespace std;
struct matr
{
double mat[3][3];
friend matr operator *(const matr a,const matr b)
...
分类:
其他好文 时间:
2014-06-22 18:23:06
阅读次数:
173
vector strsplit(const string& str)
{
vector vec;
string sstr1=str, sstr2="";
size_t np=0;
while (sstr1!="")
{
size_t dt = sstr1.find(',');
if (dt != string::npos)
{
sstr1 = str.substr(np...
分类:
其他好文 时间:
2014-06-22 18:06:11
阅读次数:
205
11488 - Hyper Prefix Sets
Time limit: 2.000 seconds
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 5000000;
vector vs;
int cnt,ans...
分类:
其他好文 时间:
2014-06-22 16:38:22
阅读次数:
199
const是一个C语言的关键字,它限定一个变量不允许被改变。使用const在一定程度上可以提高程序的安全性和可靠性,另外,了解const的作用,在看别人的代码时,对理解对方的程序有一定帮助。
1、const可以理解成是”只读变量“的限定词,从这里可以看出,const修饰的是变量,跟常量是不同的,常量是被编译器放在内存中的只读区域,当然也就不能够去修改它。而”只读变量“则是在内存中开辟一个...
分类:
编程语言 时间:
2014-06-22 15:55:31
阅读次数:
202
在使用md5函数之前要先安装openssl,以及libssl-dev。
包含头文件:#include
两种方式:
第一种:
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
int MD5_Final(unsigned char *md, MD5_CTX *c);...
分类:
系统相关 时间:
2014-06-22 15:37:03
阅读次数:
1261