www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/20/12:42:40

From: bowes AT cgocable DOT net
Message-Id: <199807201640.MAA20431@mail.cgocable.net>
To: djgpp AT delorie DOT com
Date: Mon, 20 Jul 1998 12:44:46 -0400
MIME-Version: 1.0
Subject: Help w/ CGI class

Hi folks,

I'm attempting to write a html post form handler class and it always 
fails with a call to strtoul(). Can someone help figure this out?
Code follows... and TIA!!

#include <iostream.h>
#include <stdlib.h>

void setup()	{putenv("CONTENT_LENGHT=12345");}  // For testing...

class CGIApost
{
	public:
	   	CGIApost();

   	private:
	   	char **query;
};

CGIApost::CGIApost()
{
	setup();
   	char *endptr;
	const char *l = getenv("CONTENT_LENGTH");
   	unsigned long length;
   	length = strtoul(l, &endptr, 10);              // <-- Fails here

   	cout << length << endl;
}

int main()
{
	CGIApost c;
	return 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019