There's a lot of things wrong with your program actually.
Let me point out a few:
1. You can't initialize an array of structs like that.
2. Your function getData() has a prototype where it returns 1 struct. But you create an array of 8 structs which you want to return
3. menuItemtype menuList[8] creates an array of 8 structs. That means 0-7, so when you do this: return menuList[8]; you're accessing the 9th elements and get an exception.
4. return menuList[8]; only returns ONE struct, but in you showmenu function you treat it like an array.
5. more.
I think you need to read up on how to use arrays , or better yet: vectors
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
But still I need another answer.
Yup, he's right. Nick's been doing this for a "couple" of years. I'm confused as to what you need more answers about?
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581