Decoding a query-string value and sizing its buffer

A CGI program receives a GET request whose QUERY_STRING environment variable is set to


msg=Hi%21+5%2B3%3D8


Consider only the value of msg, the text after msg=. Find the length of the encoded value in bytes, the number of %XX escapes it contains, the length of the decoded value in bytes, and the smallest char array size in bytes that holds the decoded value as a C string. Give each as a whole number.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More CGI Programming Questions: