ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
...And I sometimes forget to ask qualifiers, such as:
So, why do you want to do this instead of just adding some columns to your SQL? What if you need to search or sort based on foo? It kind of becomes difficult after foo has been concatenated into the rest of that mess...; it's time for you to lobby vigorously for CREATE, ADD and UPDATE privileges from your dbadmin.
the application of these arrays is perfect for an item with mulitple characteristics. e.g. ary.
THis would be an array with 3 storage areas in the first column 4 in the second, etc, etc. You can set them to whatever you want to set them to, most of the time it is good to make these integer variables a constant. It is pretty much a matrix that has multilple dimensions for storing information.
e.g ary[item][price][location][area][markup].......you can go from there. the more dimensions you put in the array the more integrated your loops have to be and this can be difficult if you let it get that way, so stay organized when you beginn filling it with information.
oh, and when you want to reference the third items price you would type something like ..
cout << ary << endl;
you know what to do from here i'm sure
if the options are always the same, then you might consider researching relational database some more. a table called options with ids and descriptions could solve your problem without parsing. we have a saying around here : let the database handle it. actually on second thought, there may be some parsing, but then it would be all ids and could easily be split and joined.