template<typename T, typename U> class Conversion {     typedef char Small;     class Big{char dummy[2];};     static Small Test(U)    {   }       static Big Test(...)  { }   &nbs ...
  • 16:29
  • 浏览 (132)
  • 评论 (0)
在某坛子里面逛 看到有些人再批 if( p == NULL ) delete p;p = NULL;很好奇的看了下去 原来 delete 和 free都是支持NULL指针的啊  C99 7.20.3.2 The free function The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs. C++98 5.3.5 ...
  • 10:46
  • 浏览 (111)
  • 评论 (0)
在csdn上大家寫出了各種方式-@-可是... 都太復雜了 如 1 : void replace(char *pInput, char *pOutput, char *pSrc, char *pDst) { char *pi, *po, *p; int nSrcLen, nDstLen, nLen; pi = pInput; po = pOutput; nSrcLen = strlen(pSrc); nDstLen = strlen(pDst); p = strstr(pi, pSrc); if(p) { while(p) { nLen = (int)(p ...
  • 09:39
  • 浏览 (123)
  • 评论 (0)
其實只需要這樣一段代碼     union UA     {         int a;         char c[4];     }u;     u.a = 0x12345678;     cout << hex << (unsigned short)u.c[0] <&l ...
  • 11:44
  • 浏览 (118)
  • 评论 (0)
 # The readfpl accept a file's path while is fpl(foobar play list), # and return a list which holds all the file'path sub readfpl {     my @files;     my @chunks;     my $index = 0;     open(INPUT, "< $_[0]")  & ...
  • 17:28
  • 浏览 (89)
  • 评论 (0)
一直以為它在很前面 至少和乘法是一個級別的 唉 看來自己還是很菜很菜的菜鳥
  • 15:11
  • 浏览 (92)
  • 评论 (0)
DraculaW
搜索本博客
博客分类
最近加入圈子
存档
最新评论