  Linear codes with complementary duals (abbreviated LCD) are linear codes
whose intersection with their dual are trivial. When they are binary, they play
an important role in armoring implementations against side-channel attacks and
fault injection attacks. Non-binary LCD codes in characteristic 2 can be
transformed into binary LCD codes by expansion. In this paper, we introduce a
general construction of LCD codes from any linear codes. Further, we show that
any linear code over $\mathbb F_{q} (q>3)$ is equivalent to an Euclidean LCD
code and any linear code over $\mathbb F_{q^2} (q>2)$ is equivalent to a
Hermitian LCD code. Consequently an $[n,k,d]$-linear Euclidean LCD code over
$\mathbb F_q$ with $q>3$ exists if there is an $[n,k,d]$-linear code over
$\mathbb F_q$ and an $[n,k,d]$-linear Hermitian LCD code over $\mathbb F_{q^2}$
with $q>2$ exists if there is an $[n,k,d]$-linear code over $\mathbb F_{q^2}$.
Hence, when $q>3$ (resp.$q>2$) $q$-ary Euclidean (resp. $q^2$-ary Hermitian)
LCD codes possess the same asymptotical bound as $q$-ary linear codes (resp.
$q^2$-ary linear codes). Finally, we present an approach of constructing LCD
codes by extending linear codes.
