测试
文章平均质量分 51
maowenge
这个作者很懒,什么都没留下…
展开
-
直接操作地址的值,并取地址里面的值
#include #include using namespace std; class A { public: int a; int b; }; int main() { A *(*p)=0; int a[10]={1,2,3,4,5,6,7,8,9,10}; int z=(int )&a; int *x=reinterpret_cast(z)原创 2014-11-13 10:29:07 · 1810 阅读 · 0 评论 -
测试cuda的unified memory和cudaMemcpy的加减乘除及空间申请时间对比
#include #include #include #include using namespace std; const int N=1234567; const int sample=100; const int threads=256; __global__ void judge(int *da,int *data,int sam) { cons原创 2014-10-28 17:28:43 · 1064 阅读 · 0 评论 -
交换两个结构体的内容
//交换结构体的内容 #include #include using namespace std; class lizi { public: int a; char *b; }; int main() { lizi x,y; x.a=10; x.b="I'm a"; y.a=100; y.b="I'm b"; cout cout swap(x,原创 2014-10-31 11:19:25 · 8221 阅读 · 0 评论