Using C++ language with object-oriented feature, a P-version adaptive FEM program was designed, which contains the modules of shape function, high grade element, adaptive course and error estimate. In the function of solving linear equations, a data structure that can save storage space and computation resource was presented. The provided examples show the correction of the theory and program.