Step 1: Calculate the hydroxide ion concentration.
Given,
\[
\mathrm{pH}=12.
\]
Therefore,
\[
\mathrm{pOH}=14-12=2.
\]
Hence,
\[
[\mathrm{OH^-}]
=
10^{-2}\,\mathrm{mol\,L^{-1}}.
\]
Step 2: Find the number of moles of NaOH.
Since NaOH is a strong base,
\[
[\mathrm{NaOH}]
=
[\mathrm{OH^-}]
=
10^{-2}\,\mathrm{mol\,L^{-1}}.
\]
For
\[
1.0\,\text{L},
\]
\[
n
=
10^{-2}\times1
=
0.01\;\text{mol}.
\]
Step 3: Calculate the required mass.
The molar mass of NaOH is
\[
40\;\mathrm{g\,mol^{-1}}.
\]
Thus,
\[
m
=
0.01\times40
=
0.4\;\text{g}.
\]
Hence,
\[
\boxed{0.4\;\text{g}.}
\]
Therefore, the correct option is \(\boxed{(C)}\).