We know that if $X$ is a compact connected complex manifold,then every holomorphic function on $X$ is constant. Now,supposed that $X$ is not necessarily connect, then we can choose a connected component. We know that connected component is closed subset and every closed subset of a compact set is also compact. So the connected component is also compact, then we can deduced that every holomorphic function on the connected component is constant. Then We can deduced that every holomorphic function on $X$ is locally constant.
I think this may be not right but I can't find where is the problem in my proof in the above.