The study of the structure and functions of carbohydrates, including sugars and starches, in living systems.