DFS is the most important graph traversal algorithm and has been adopted as the default traversal module for many software system. In this article, the non-recursive implementation of DFS in C++ is given. The basic idea is to record the vertexes during traversal by utilizing a stack, and decide whether a vertex need to be pushed into the stack according to a mark array which indicate whether the current vertex has been visited.