?
Solved

structure array problem/question

Posted on 2003-03-03
4
Medium Priority
?
220 Views
Last Modified: 2010-04-17
hello all

I am having problems with an idea regarding an App I am writing, and how to make use of a structure array.

Here is my question(s)...

I want to define a structure like
struct entity {
    char *entityKey;
    char *entityValue;
} *myentity;

Now I want to read in any number of entityKey, entityValue pairs.... Since the number of key/value pairs can vary from run to run of the application I do not want to statically define an upper limit on the size of my structure array, thus I would like to dynamically allocate it as I need it... make sense??? I hope...

Thus here are my questions is the above structure valid? if so how can I add a key/value pair to it? and then increment to the next point in the array for the next value/key pair... and then how do i read them.. how do I cycle through the structure once I have filled it up...

The goal is to not dimension the size of the structure array... How can I do this???

pseudo code or an example would be great...

any suggestions???

thanks all

echardrd
0
Comment
Question by:echardrd
  • 2
4 Comments
 
LVL 6

Expert Comment

by:gj62
ID: 8060469
0
 

Accepted Solution

by:
rechard earned 0 total points
ID: 8084950
thanks...
0
 

Expert Comment

by:SpideyMod
ID: 8085206
echardrd =rechard

echardrd,
Having multiple accounts is a violation of the membership agreement: http://www.experts-exchange.com/jsp/infoMemberAgreement.jsp 
I have removed all question points from both accounts so no further damage can be done.  An administrator will be contacting you shortly so they can discuss your options.
It is best if you come clean and indicate all the accounts you use when the administrator contacts you.
SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:rechard
ID: 8085638
SpideyMod my absolute sincerest apologies. It was absolutely not my intention to do this. My intent was tolet these guys know I appreciated there help and then to award points to them... Since I was smart enough to post the same question twice, and two different guys helped me gj62 and Kdo, I was going to award both of them points. gj62 on this question since he was the only one to respond here and Kdo on the other post for this question since he only responded there.. It was absolutely not my intent to do this.

Please take my word for it and distribute the points to gj62 on this post http://www.experts-exchange.com/Programming/Q_20537024.html and to
Kdo for the post http://www.experts-exchange.com/Programming/Q_20537021.html

Once again sorry for the confusion, but having these 2 accounts on 2 different machines with "remember me" selected has added to my confusion.

Sincerest regrets.
echardrd/rechard
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question