Text adventures have been around since the likes of Colossal Cave which I first played in 1980. They were quite popular on the early home computers like ZX 81 which were quite limited in RAM and capability. With the capacity of modern computers there are Interactive fiction (the modern name for adventure games) games with over a million words of text.
I suspect I’d probably want to code them in another language because C isn’t the best language when it comes to text. Nevertheless other have gone ahead and there’s an almost complete (20 out of 23 lessons) on how to program a text adventure in C on GitHub.
It’s a fine piece of work and some of the 20 articles like 20. Combat are quite long with lots of annotated code. At the bottom of each page you can download the source code on that page as a zip file or run the sources on repl.it. If you are learning C the line-by-line annotations really help explain why something was done.