I'm having a hard time trying to figure out how to implement this.

Develop a program written in C that will handle encoding and decoding of
CGI data.

* Your program should run from a command-line interface in Linux (preferably)
or DOS. It should prompt the user to enter these items:
1. Name
2. Address
3. Phone number

* Once you collect this data, CGI encode it and display the encoded string.

* Decode the CGI data, and display a label and associated value (these should
match exactly what the user entered.)

* Do not link in or use any code except what can be found in the standard
libraries.

Now I can set up and make a program that will fulfill the data requirements with executable that a user runs, though I'm not sure how to convert it to CGI and display it from there. I can also make the CGI script so that if the user goes to a webpage, puts in the information in the requirements will be fulfilled. My problem is how do I encode and decode data as CGI from a command line or shell, and how can data from an executable be made into CGI data. Thanks.