1 /* 2 WARNING: This file was generated by the dkct program (see 3 http://dktools.sourceforge.net/ for details). 4 Changes you make here will be lost if dkct is run again! 5 You should modify the original source and run dkct on it. 6 Original source: tdkct.ctr 7 */ 8 9 /** @file tdkct.c The tdkct module. 10 */ 11 12 #include <stdio.h> 13 #include <stdlib.h> 14 15 16 17 18 double square_area(double sidelength)19square_area(double sidelength) 20 { 21 double result; 22 23 result = sidelength * sidelength; 24 25 return result; 26 } 27 28 29 static const double sidelengths[] = { 30 1.0, 2.3, 4.5, 6.7 31 }; 32 33 34 static const 35 size_t sz_sidelengths = sizeof(sidelengths)/sizeof(double); 36 main(int argc,char * argv[])37int main(int argc, char *argv[]) 38 { 39 char *language = NULL; 40 int exitcode = 1; 41 size_t i; 42 43 44 45 language = getenv("LANG"); /* May be NULL! */ 46 47 for (i = 0; i < sz_sidelengths; i++) { 48 49 50 printf( 51 "Length: %lg Area: %lg\n", 52 sidelengths[i], 53 square_area(sidelengths[i]) 54 ); 55 } 56 57 58 exit(exitcode); 59 } 60 61 62