Results of a search for supersymmetry via direct production of third-generation squarks are reported, using 20.3 fb(-1) of proton-proton collision data at root s = 8 TeV recorded by the ATLAS experiment at the LHC in 2012. Two different analysis strategies based on monojetlike and c-tagged event selections are carried out to optimize the sensitivity for direct top squark-pair production in the decay channel to a charm quark and the lightest neutralino ((t) over tilde (1) -> c + (chi) over tilde (0)(1)) across the top squark-neutralino mass parameter space. No excess above the Standard Model background expectation is observed. The results are interpreted in the context of direct pair production of top squarks and presented in terms of exclusion limits in the (m((t) over tilde1), m((chi) over tilde 10)) parameter space. A top squark of mass up to about 240 GeV is excluded at 95% confidence level for arbitrary neutralino masses, within the kinematic boundaries. Top squark masses up to 270 GeV are excluded for a neutralino mass of 200 GeV. In a scenario where the top squark and the lightest neutralino are nearly degenerate in mass, top squark masses up to 260 GeV are excluded. The results from the monojetlike analysis are also interpreted in terms of compressed scenarios for top squark-pair production in the decay channel (t) over tilde (1) -> b + ff' + (chi) over tilde (0)(1) and sbottom pair production with (b) over tilde -> b + (chi) over tilde (0)(1), leading to a similar exclusion for nearly mass-degenerate third-generation squarks and the lightest neutralino. The results in this paper significantly extend previous results at colliders.