For a Tychonoff space X by \(C_p(X)\) we denote the space of continuous real valued functions on X endowed with the pointwise topology, and C(X) denotes the Banach space endowed with the uniform topology provided X is compact. The classical two results characterizing compact scattered spaces in terms of C(X) and \(C_p(X)\) assert that a compact space X is scattered if and only if C(X) is an Asplund space (Namioka-Phelps) if and only if \(C_p(X)\) is a Fréchet–Urysohn space (Gerlits, Pytkeev). We provide another result of this type by showing the following Theorem: An infinite compact space X is scattered if and only if \(C_p(X)\) contains no closed \(\sigma \) -compact infinite-dimensional vector subspace if and only if \(C_p(X)\) contains no infinite-dimensional vector subspace admitting a fundamental sequence of bounded sets if and only if every vector subspace of \(C_p(X)\) is bornological. The above Theorem fails if X is nondiscrete scattered and noncompact. On the other hand, if X is a countable metric space which is not scattered, \(C_p(X)\) contains a closed infinite-dimensional \(\sigma \) -compact subspace. Moreover, if \(X=F\times [1,\omega ]\) and F is discrete with \( |F| \ge \mathfrak {d}, \) where \(\mathfrak {d}\) is the dominating cardinal, then \(C_p(X)\) contains a closed infinite-dimensional \(\sigma \) -compact subspace, but if \(X=\mathbb {N}\times [1,\omega ]\) the corresponding space \(C_p(X)\) does not contain such subspaces. A variant of Theorem is also obtained characterizing infinite Tychonoff spaces X for which all compact subsets are scattered. These results are also motivated by a remarkable theorem of Velichko stating that for an infinite Tychonoff space X the space \(C_p(X)\) is not \(\sigma \) -compact. Several illustrating examples involving spaces \(c_0\) , \(\ell _{\infty }\) and the space \(Lip_0(M)\) with the pointwise topology are provided and discussed.