目前分類:C and C++ (177)

瀏覽方式: 標題列表 簡短摘要

假設你有四個 thread 要去計算一些數據,然後 sum 起來給 global 變數:sum4 ,

你會使用哪些方法 ?

hedgezzz 發表在 痞客邦 留言(0) 人氣()

class Mars
{

hedgezzz 發表在 痞客邦 留言(0) 人氣()

  • 這是一篇加密文章,請輸入密碼
  • 密碼提示:just 2 words
  • 請輸入密碼:

https://github.com/0xmalloc/c-log

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

  • 這是一篇加密文章,請輸入密碼
  • 密碼提示:just 2 words
  • 請輸入密碼:

http://hedgezzz.pixnet.net/blog/post/27667546

這裡使用的 hash table 運用在台股代碼 array , 共有 12957 筆資料 , 看要找某一個代碼的 array index

hedgezzz 發表在 痞客邦 留言(2) 人氣()

一支小小的 semaphore 程式

sem1.cpp

hedgezzz 發表在 痞客邦 留言(0) 人氣()

template<class T>
void swap_elems(T& lhs, T& rhs)

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://oopscenities.net/2012/04/30/c-sfinae/

template <typename T>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

inline  向 compiler 保證 , 你不管看到幾次 這個 function , 它的內容都一樣 !!

還有建議 compiler 將內容 "插入" 呼叫它的 function , compiler 可以選擇接受 or not !!

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://definedbehavior.blogspot.tw/2011/08/value-semantics-copy-elision.html

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

這個例子只能用 c++11 , c++0x compiler 會失敗 !!!

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://definedbehavior.blogspot.tw/2011/08/value-semantics-copy-elision.html

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

class Mars
{

hedgezzz 發表在 痞客邦 留言(0) 人氣()

從這裡來的文章 :

http://my.safaribooksonline.com/book/programming/cplusplus/9780321545183/associative-containers/ch03lev1sec6

hedgezzz 發表在 痞客邦 留言(0) 人氣()

alloca allocate memory on stack , 有以下優點 :

• There is very little overhead to the allocation process because the microprocessor

hedgezzz 發表在 痞客邦 留言(0) 人氣()

class student
{

hedgezzz 發表在 痞客邦 留言(0) 人氣()

struct People_
{

hedgezzz 發表在 痞客邦 留言(1) 人氣()

#include <stdio.h>
#include <stdbool.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

我在 stackoverflow 問了一個問題  !!!

http://stackoverflow.com/questions/20490058/confusing-core-dump-while-implementing-semaphore

hedgezzz 發表在 痞客邦 留言(0) 人氣()