Let $A$ be a path-connected set of $\mathbb{R}^m$ and let $w\in\Omega^1(A)$ be a differential form of degree 1. The following conditions are equivalent:
(i) $w$ is exact.
(ii)Any curve $\gamma$ of $C^1$ class, closed in $A$, then
$\int_\gamma w=0$
The definition of a exact differential form I have is the following:"$w$ is an exact differential form if there is $f\in C^{k+1}(M,\mathbb{R})$ such as $df=w$. And f is called the primitive of $w$".
I know from another proposition that if $w$ is an exact differential form $\int_\gamma w=f(\gamma(b))-f(\gamma(a))$.
However I cannot see how condition (i) implies (ii). The fact $w$ is exact does not necessarily implies $w$ to be $0$.
Question:
How can it be proved condition (i) implies (ii)?