TO_RUN web application can help You in understanding CGI basics. Try submitting different data in different ways and look what you get.
After You compiled to_run.cpp and got to_run.exe place to_run.exe in CGI dir of Your server (i.e. folder that looks as /cgi-bin/ from web). Then URL of application would be /cgi-bin/to_run (relatively to server root).
GET method form:
POST method form: