Linear codes are an important class of error-correcting codes and widely used in secret sharing schemes, combinational designs, authentication codes and so on. Let \(C(n-1,q)\) be the p-ary linear code generated by the rows of the incidence matrix of points and hyperplanes of \(PG(n-1,q)\) , with \(q=p^s\) , \(s\ge 1\) and p prime. The weights of codewords in \(C(n-1,q)\) have attracted a lot of research in recent years. Let \(D\subseteq {\mathbb {F}}_q^n\backslash \{\textbf{0}\}\) . In this paper, we show that if the complete weight enumerator of the linear code defined by D is known, then a codeword of \(C(n-1,q)\) can be constructed. If \(q>2\) is even, we prove that the weight of each codeword of C(2, q) is congruent to 0 or 1 modulo 4, and give bounds on the weights of codewords generated as sums of r rows of the incidence matrix with \(2\le r\le q+2\) even. In addition, if q is even, we provide a family of \(q^2+q+1\) hyperovals using a projective bundle in PG(2, q), called linear hyperovals, and prove that the corresponding codewords generate the dual code \(C(2,q)^\bot \) . Moreover, we prove that the codeword corresponding to any hyperoval is a linear combination of exactly \(q+2\) codewords corresponding to linear hyperovals.