学习
文章平均质量分 68
smallprogramer
这个作者很懒,什么都没留下…
展开
-
请教一个sizeof在模版函数内无法正常获取大小的问题。
#include using namespace std; template void Swap(T a[], T b[], int n) { for ( int n = 0; i { T tm = a[i]; a[i] = b[i]; b[i] = tm[i]; } } /* 在这里我想把Swap改写一下,少传一个参数进来,把代码改写成原创 2013-01-24 12:01:39 · 386 阅读 · 0 评论 -
请教一个vector的push_back问题
#include "stdafx.h" #include #include using namespace std; static long g_g = 0, g_x = 0; typedef struct tagMy { int i; char sz[32]; tagMy() { cout memset(this, sizeof(tag原创 2013-02-28 17:32:01 · 484 阅读 · 0 评论