?
Solved

structure array problem/question

Posted on 2003-03-03
4
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

752 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