Getting form data from a CGI script written i C++

What is the easiest way to get form data from a cgi script written in c++ (VC5.0), i would like to create a function that i could call like this GetFormData(formfieldname) and it would return the value for the formfieldname(it doesn't matter whether its post or get). It is very easy in Visual Basic, but i am new to c++ and would really like some help with the aid of some source code or a hint to what i should do.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Would you accept a C function?
thomasschmidtAuthor Commented:
Yes please, and thank you very much!
Data from a form is sent in this form:
where varx is the names fields in the form and the valuex is the values typed into the form from the browser.

This data is transfered in two ways.

If the method=GET its stored in the enviroment variable QUERY_STRING and if the method=post its sent via stdin

Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

thomasschmidtAuthor Commented:
I am using the get method. I was wondering what the easiest method to "dekode" the QUERY_STRING is, so i could use a function to call with the var and get the value back, it is just because i am a lousy c++ programmer i have done the same in the Visual Basic and its not so difficult.
BTW, if you are satisfied with my code, would you mind letting me post it as an answer?
To df:

yours is not an answer, so why did not you just post a comment??
Thank you Julio, nut how do i give you the points, I am only allowed to give the points to DF (no offense)??????
thomasschmidtAuthor Commented:
You just reject his answer, so i'll be able to submit mine as the answer.
Mineis also an answer... I just didnt enter code... I told him hwo it works... much better than just copying someones code and dotn usertsand what it does...


The code works well and _fast_ as is.

Just get rid of that '{' at the line:

"if(*curs == '=') {"



The question was:

"i would like to create a function that i could call like this GetFormData(formfieldname) and it would return the value for the formfieldname..."

Do you really think your was an answer?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.