|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Hi i am making a project for my school.The project is a multiple choice questions
Questions are in a text file.They are displayed on screen then there are options a,b,c or d for user to select. How can i use the "struct" in order the choice given by the user to be stored in this stucture and then how can i access to that? |
|
#2
|
||||
|
||||
|
I'd like to ask you a couple of questions first:
a. Do you know what a "struct" is in the first place? b. If you do know the answer to (a), would you please define exactly what you want to store in "the struct" and why you don't want an array?
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
please help...
Someone told me that i should use data structure.But i dont know.Ca o\you tell me what am i going to do to make the project..
|
|
#4
|
|||
|
|||
|
ggiannakis86> I'm sorry to say this isn't the "please do my homework for me" forum. Please do some searching on Google prior to responding. We're happy to help, but you have to meet us half way at least.
__________________
BookMooch.com : Give books away. Get books you want. |
|
#5
|
||||
|
||||
|
Quote:
Do you know what an array is? You're better off getting your basics straight before digging into more advanced stuff. |
|
#6
|
||||
|
||||
|
A struct would be a very inefficent way of storing a single variable, under most conditions. Why would you want to do that?
Let us presume that your interlocutor had expressed conditions which you have not imparted to us. (Shame on you.) In that case, one would access the members of the structure (even if there were a single member) in the traditional and syntactically correct ways. One has to ask: Do you know what the hell you are doing, or are you just completely up in the air?
__________________
C/C++ pointers (Original in the "Commonly Asked Questions" thread). |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Using struct to store data and access data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|