Žmegač was born in Slatina on 21 March 1929. After finishing elementary school in his home town he went on to attend gymnasiums in Virovitica and Osijek. He then enrolled at the University of Zagreb Faculty of Philosophy and earned a double major degree in Yugoslav and German studies. He also studied musicology and German studies in University of Göttingen. He earned a doctorate in 1959 and later spent almost 30 years as a tenured university professor teaching German literature at the Faculty of Humanities and Social Sciences in Zagreb, from 1971 until his retirement in 1999. He was made professor emeritus in 2002.