HCl, H2SO4, HNO3, etc., dissociate in aqueous solutions to give H+(aq) ions, which are a vital part of an acid and determine the acidic property of acids.
C6H12O6 (glucose) and C2H5OH (alcohol) do not dissociate in aqueous solutions even though they contain hydrogen atoms.
Hence, HCl, H2SO4, HNO3, etc., show acidic character in aqueous solutions, whereas solutions of compounds such as C6H12O6 (glucose) and C2H5OH (alcohol) do not show acidic character.