The function of a memory card in a digital camera is to store the captured photos and videos. It acts as a storage medium where the camera saves all the data files. The memory card provides the necessary space for the camera to store images and videos as the internal memory of the camera is often limited. It allows users to take multiple photos or record videos without worrying about running out of storage. The memory card can be removed from the camera and inserted into a computer or other device for transferring and viewing the stored files.