some c/c++ code snippet