topical media & game development
lib-ch-example-cgi-vla.ch / ch
#!/bin/ch
/* Variable length array.
*/
include<stdio.h>
int main() {
int length;
setvbuf(stdout, NULL, _IONBF, 0);
length = atoi(getenv("CONTENT_LENGTH"));
char input[length];
printf("Content-type: text/plain\n\n");
printf("Today's date is: \%s\n", __DATE__);
printf("CONTENT_LENGTH = \%d\n", length);
scanf("\%s", input);
printf("input from client = \%s\n", input);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.