home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1990 MetaWare Incorporated; All Rights Reserved. 90-Aug-13 */
-
- /**** name=fabs ****/
- #define main() TEST_fabs()
-
- /*
- This programs demonstrate the behavior of the functions fabs, abs, and
- cabs, labs.
- */
- #include <math.h>
- #include <stdlib.h>
- #include <stdio.h>
-
- void main() {
- struct complex ab;
-
- ab.x = 3.0;
- ab.y = -4.0;
-
- double x=-12.00, y=3.0, z=-2.0;
- double result;
- int k=-20, j=-15, i=2;
- long a=50, b=10;
-
- puts("Testing fabs...\n");
- result = fabs(x+z*fabs(z-y*fabs(x)));
- printf("Result of fabs(x+z*fabs(z-y*fabs(x)))"
- " ==> %+.2e.\n",result);
-
- result = fabs(k-fabs((double)j));
- printf("Result of fabs(k-fabs(j))"
- " ==> %+.2e.\n",result);
-
- result = _cabs(ab);
- printf("Result of _cabs(ab)"
- " ==> %.2f.\n",result);
-
- ab.y=abs(x);
- result = _cabs(ab);
- printf("Result of _cabs(ab) when ab.y=abs(x)"
- " ==> %.2lf.\n",result);
-
- printf("Result of abs(i+j*abs(j-k))"
- " ==> %d.\n",abs(i+j*abs(j-k)) );
- printf("Result of labs(a-labs(a*b))"
- " ==> %d.\n", labs(a-labs(a*b)));
- }
- /* End fabs */
- #undef main
- /**** name=fclose ****/
- #define main() TEST_fclose()
-
- /*
- The program fragment below attempts to open test.dat for reading. It
- later attempts to close test.dat prior to opening fclose.tmp for writing
- (using the same FILE variable).
- */
-
- #include <stdio.h>
- #define FAILURE (-1)
- int main() {
- FILE *FP;
-
- if ((FP = fopen("test.dat", "r")) == NULL) {
- perror("fopen of test.dat");
- return FAILURE;
- }
- if (fclose(FP) != 0)
- perror("fclose of test.dat");
- if ((FP = fopen("fclose.tmp", "w")) == NULL) {
- perror("fopen of fclose.tmp");
- return FAILURE;
- }
- puts("fopen and fclose were successful.");
- }
- /* End fclose */
- #undef main
- #undef FAILURE
- /**** name=_fcvt ****/
- #define main() TEST__fcvt()
-
- /*
- This program uses _fcvt to convert the number "E" to a string.
- */
-
- #include <stdlib.h>
- #define E 2.718281828459045
-
- void main() {
- char *result; /* _fcvt return string. */
- int dpos; /* Stored decimal-point position. */
- int sign; /* Sign of converted number. */
-
- result = _fcvt(E, 5, &dpos, &sign);
- printf("------- _fcvt test --------\n");
- printf(" value: %0.15lf\n", E);
- printf("--------------------------\n");
- printf("resulting string: %s\n decimal point @: %d\n"
- " sign: %d\n", result, dpos, sign);
- }
-
- /* End _fcvt */
- #undef main
- #undef E
- /**** name=ferror ****/
- #define main() TEST_ferror()
-
-
- /*
- The program below tests ferror by calling fseek with an invalid value.
- */
-
- #include <stdlib.h>
- #include <stdio.h>
- #define FAILURE (-1)
-
- int main() {
- FILE *FP1;
-
- puts("Testing ferror...\n");
- if((FP1 = fopen("test.dat", "r")) == NULL) {
- perror("fopen of test.dat failed.\n");
- return FAILURE;
- }
-
- /* call fseek with invalid whence */
- fseek (FP1, 0, -1);
- if(ferror(FP1))
- perror("ERROR seeking test.dat");
-
- fclose (FP1);
- }
- /* End ferror */
-
- #undef main
- #undef SIZE
- #undef FAILURE
- /**** name=fgetc ****/
- #define main() TEST_fgetc()
-
- /*
- This program copies test.dat character by character to fgetc.tmp and to
- standard output. This illustrates the use of fgetc, fputc, and
- fputchar.
- */
- #include <stdio.h>
-
- void main() {
- FILE *FP1, *FP2;
-
- if ((FP1 = fopen("test.dat", "r")) == NULL)
- perror("fopen of test.dat");
- if ((FP2 = fopen("fgetc.tmp", "w")) == NULL)
- perror("fopen of fgetc.tmp");
- while (!feof(FP1))
- fputc(fputchar(fgetc(FP1)), FP2);
- }
-
- /* End fgetc */
- #undef main
- /**** name=fgetpos ****/
- #define main() TEST_fgetpos()
-
- /*
- This program opens test.dat for read and fgetpos.tmp for writing. It
- copies data from test.dat to fgetpos.tmp until four lines are copied.
- Then the file position is set. Next, a line is read and printed, the
- file position is reset, and data copying continues.
- */
-
- #include <stdio.h>
- #define SIZE (15)
- #define FAILURE (-1)
-
- int main() {
- FILE *FP1, *FP2;
- char s[SIZE];
- int i = 0;
- fpos_t *pos;
-
- puts("Testing fgetpos...\n");
-
- if ((FP1 = fopen("test.dat", "r")) == NULL) {
- perror("fopen of test.dat fails.");
- return FAILURE;
- }
- else puts ("test.dat is open.");
- if ((FP2 = fopen("fgetpos.tmp", "w")) == NULL) {
- perror("fopen of fgetpos.tmp fails.");
- return FAILURE;
- }
- else puts ("fgetpos.tmp is open for writing.");
- if (FP1 && FP2) { /* Check for file pointers. */
- while (i < 5) {
- /* Print if something was read. */
- if(fgets(s,SIZE,FP1)) fputs(s,FP2);
- else fprintf(FP2,"** EOF IS DETECTED. **\n");
- i++;
- }
- fgetpos(FP1,pos);
- while (i < 7) {
- /* Print if something was read. */
- if(fgets(s,SIZE,FP1)) fputs(s,FP2);
- else fprintf(FP2,"** EOF IS DETECTED. **\n");
- i++;
- }
- fsetpos(FP1,pos);
- while (!feof(FP1)) {
- /* Print if something was read. */
- if(fgets(s,SIZE,FP1)) fputs(s,FP2);
- else fprintf(FP2,"** EOF IS DETECTED. **\n");
- }
- }
- fclose(FP1);
- fclose(FP2);
- puts("fgetpos test complete.");
- }
- /* End fgetpos */
- #undef main
- #undef SIZE
- #undef FAILURE
- /**** name=fgets ****/
- #define main() TEST_fgets()
-
- /*
- The program below copies test.dat line by line to fgets.tmp. This
- example illustrates the use of fgets, fputs, and fopen.
- */
-
- #include <stdio.h>
- #define LINESIZE (80)
-
- void main() {
- FILE *FP1, *FP2;
- char line[LINESIZE];
-
- if ((FP1 = fopen("test.dat", "r")) == NULL)
- perror("cannot open test.dat");
- if ((FP2 = fopen("fgets.tmp", "w")) == NULL)
- perror("cannot open fgets.tmp");
- while (fgets(line, LINESIZE, FP1)) {
- /* fgets returns NULL (FALSE) when it */
- /* cannot get any more characters. */
- fputs(line, stdout);
- fputs(line, FP2);
- }
- }
- /* End fgets */
- #undef main
- #undef LINESIZE
- /**** name=_fieeetomsbin ****/
- #define main() TEST__fieeetomsbin()
- /* End _fieeetomsbin */
- #undef main
- /**** name=__FILE__ ****/
- #define main() TEST___FILE__()
- /* End __FILE__ */
- #undef main
- /**** name=_filelength ****/
- #define main() TEST__filelength()
-
- /*
- This program determines the length of a file.
- */
-
- #include <stdio.h>
- #include <io.h>
-
- FILE *stream;
- long length;
-
- void main() {
- /* Must open file first. */
- stream = fopen("test.dat", "r");
- length = _filelength (fileno(stream));
- if (length == -1L)
- puts("Could not find file test.dat.");
- else
- printf("test.dat is %ld bytes long.\n", length);
- }
-
- /* End _filelength */
- #undef main
- /**** name=_fileno ****/
- #define main() TEST__fileno()
-
- /*
- Program to obtain the predefined file handles.
- */
- #include <stdio.h>
-
- void TEST__fileno() {
-
- puts("Predefined file handles:");
- puts("\nDevice handle");
- printf("Standard input %d\n", _fileno(stdin));
- printf("Standard output %d\n", _fileno(stdout));
- printf("Standard error %d\n", _fileno(stderr));
- }
- /* End _fileno */
- #undef main
- /**** name=_fmalloc ****/
- #define main() TEST__fmalloc()
-
- #include <stdio.h>
- #include <malloc.h>
-
- void main() {
- _Far char *new_array;
-
- new_array = _fmalloc(15000 * sizeof(long));
-
- if (new_array == NULL) {
- printf("_fmalloc: Not enough memory"
- " for 15,000 longs\n");
- new_array = _fmalloc(5000 * sizeof(long));
- if (new_array == NULL)
- printf("_fmalloc: Not enough memory"
- " for 5,000 longs\n");
- else
- printf("_fmalloc: Allocated 5,000 longs"
- " at %x:%x\n",
- (unsigned long) (_Near) new_array >> 16,
- (unsigned long) (_Near) new_array);
- }
- else
- printf("_fmalloc: Allocated 15,000 longs"
- " at %x:%x\n",
- (unsigned long) (_Near) new_array >> 16,
- (unsigned long) (_Near) new_array);
- }
- /* End _fmalloc */
- #undef main
- /**** name=_fmsbintoieee ****/
- #define main() TEST__fmsbintoieee()
- /* End _fmsbintoieee */
- #undef main
- /**** name=fopen ****/
- #define main() TEST_fopen()
- /* End fopen */
- #undef main
- /**** name=_FP_X ****/
- #define main() TEST__FP_X()
-
- /*
- This program displays the segment and offset of a far pointer.
- */
- #include <dos.h>
- #include <stdio.h>
-
- void main() {
- struct ovly {
- int offs;
- short segs;
- };
- union {
- _Far char *a;
- struct ovly q;
- } x;
- unsigned int seg, off;
-
- x.q.offs = 320; /* Line two, column one. */
- x.q.segs = 0x1C; /* Phar Lap screen segment. */
- puts("\nchar *a is stored at: ");
-
- seg = _FP_SEG(x.a);
- off = _FP_OFF(x.a);
- printf("Segment: 0x%.4x\n"
- "Offset : 0x%.4x\n", seg, off);
- }
- /* End _FP_* */
- #undef main
- /**** name=fprintf ****/
- #define main() TEST_fprintf()
-
- #include <stdio.h>
- #define FAILURE (-1)
-
- int main() {
- FILE *FP;
- char s[14] = "like this one", c = '*';
- int i = 10, x = 255, o = 45;
- double d = 3.1415927, nf = -3.449123;
-
- if ((FP = fopen("fprintf.tmp", "w")) == NULL) {
- perror("Cannot open fprintf.tmp.");
- return FAILURE;
- }
-
- fprintf(FP,"fprintf prints strings (%s),\n", s);
- fprintf(FP,"decimal numbers(%d),", i);
- fprintf(FP," hex numbers(%04X),\n", x);
- fprintf(FP,"floating-point numbers (%+.4e)\n", d);
- fprintf(FP,"percent signs(%%),\n");
- fprintf(FP,"characters (%-5c),\n", c);
- fprintf(FP,"negative floating-points"
- " (% 010.2e)\n", nf);
- fprintf(FP,"and even octal numbers (%-+#5o).", o);
- printf("fprintf test complete.");
- }
-
- /* End fprintf */
- #undef main
- #undef FAILURE
- /**** name=fputc ****/
- #define main() TEST_fputc()
- /* End fputc */
- #undef main
- /**** name=_fputchar ****/
- #define main() TEST__fputchar()
- /* End _fputchar */
- #undef main
- /**** name=fputs ****/
- #define main() TEST_fputs()
- /* End fputs */
- #undef main
- /**** name=fread ****/
- #define main() TEST_fread()
-
- /*
- The program below copies test.dat, a block at a time, to fread.tmp.
- This example illustrates the use of fread and fwrite.
- */
- #include <stdio.h>
- #define FAILURE (-1)
- #define BLOCKSIZE (128)
- #define MAXBUF (256)
-
- int main() {
- char buf[MAXBUF];
- FILE *FP1, *FP2;
- size_t i,j;
-
- puts("Testing fread...\n");
- if ((FP1 = fopen("test.dat", "r")) == NULL) {
- perror("Cannot open test.dat");
- return FAILURE;
- }
- if ((FP2 = fopen("fread.tmp", "w")) == NULL) {
- perror("Cannot open fread.tmp.");
- return FAILURE;
- }
- i = fread(buf, sizeof(char), BLOCKSIZE, FP1);
- j = fwrite(buf, sizeof(char), i, FP2);
- printf("i = %d, and j = %d.\n",i,j);
- if (fclose(FP1) == 0)
- puts("File test.dat is now closed.");
- else puts("Unable to close file test.dat.");
- if (fclose(FP2) == 0)
- puts("File fread.tmp is now closed.");
- else puts("Unable to close file fread.tmp.");
- }
-
- /* End fread */
- #undef main
- #undef FAILURE
- #undef BLOCKSIZE
- #undef MAXBUF
- /**** name=freopen ****/
- #define main() TEST_freopen()
-
- /*
- The program below first attempts to open freopen1.tmp for writing. If
- the open succeeds, it associates a number of file pointers with
- freopen1.tmp. The subsequent call to freopen attempts to close
- freopen1.tmp and open freopen2.tmp using the same FILE variable. That
- causes all file pointers previously associated with freopen1.tmp to
- reference freopen2.tmp. If the pair of calls fclose/fopen were used in
- the place of freopen, each file pointer would have to be individually
- updated.
- */
-
- #include <stdio.h>
- #define FAILURE (-1)
- int main() {
- FILE *Current_file, *Log_file, *Out_file, *Err_file;
-
- if((Current_file=fopen("freopen1.tmp","w"))==NULL) {
- perror("Cannot open freopen1.tmp");
- return FAILURE;
- }
- Log_file = Out_file = Err_file = Current_file;
- printf("Log_file =>%x\n",Log_file);
- printf("Out_file =>%x\n",Out_file);
- printf("Err_file =>%x\n",Err_file);
- printf("Current_file =>%x.\n\n",Current_file);
- if((Current_file =
- freopen("freopen2.tmp","w",Current_file))==NULL) {
- perror("freopen of freopen2.tmp");
- return FAILURE;
- }
- else puts("freopen2.tmp is open.");
- }
- /* End freopen */
- #undef main
- #undef FAILURE
- /**** name=frexp ****/
- #define main() TEST_frexp()
-
- #include <stdio.h>
- #include <math.h>
-
- void main() {
- int exp;
- double x, num=73.0;
-
- puts("Testing frexp...\n");
- x = frexp(num, &exp);
- printf("For The Number ==> %e.\n",num);
- printf("Fractional Part => %e,\n"
- "Exponent Part => %d.\n", x, exp);
- }
-
- /* End frexp */
- #undef main
- /**** name=fscanf ****/
- #define main() TEST_fscanf()
-
- #include <stdio.h>
- #define FAILURE (-1)
-
- int main() {
- FILE *FP;
- char s1[11], s2[19] = "but missed eleven.";
- int i, j;
-
- puts("Testing fscanf...\n");
- if ((FP = fopen("test.dat", "r")) == NULL) {
- perror("Cannot open test.dat.");
- return FAILURE;
- }
- fscanf(FP,"%11c%d %%%d %[^z]z", s1, &i, &j, s2);
- printf("%11s%d, %s%s", s1, i,
- j == 11 ? "11, " : "",s2);
- printf("\n");
- }
-
- /* End fscanf */
- #undef main
- #undef FAILURE
- /**** name=fseek ****/
- #define main() TEST_fseek()
-
- /*
- This program copies the second line of test.dat to fseek1.tmp, then to
- fseek2.tmp. This example illustrates the use of fseek and ftell.
- */
-
- #include <stdio.h>
- #define FAILURE (-1)
- #define BLOCKSIZE (512)
-
- int main() {
- FILE *FP1, *FP2, *FP3;
- char line[BLOCKSIZE];
- long place_mark;
-
- FILE *topen(char *f,char *mode) {
- FILE *FP;
- if ((FP = fopen(f,mode)) == NULL)
- perror("Cannot open any files");
- return FP;
- }
-
- if (((FP1 = topen("test.dat","r")) == NULL) ||
- ((FP2 = topen("fseek1.tmp","w")) == NULL) ||
- ((FP3 = topen("fseek2.tmp","w")) == NULL) )
- return FAILURE;
-
- fgets(line, BLOCKSIZE, FP1);
- place_mark = ftell(FP1);
- if (fgets(line, BLOCKSIZE, FP1)) {
- fputs(line, FP2);
- fputs(line, stdout);
- }
- fseek(FP1, place_mark, SEEK_SET);
- if (fgets(line, BLOCKSIZE, FP1)) {
- fputs(line, FP3);
- fputs(line, stdout);
- }
- }
- /* End fseek */
- #undef main
- #undef FAILURE
- #undef BLOCKSIZE
- /**** name=fsetpos ****/
- #define main() TEST_fsetpos()
- /* End fsetpos */
- #undef main
- /**** name=ftell ****/
- #define main() TEST_ftell()
- /* End ftell */
- #undef main
- /**** name=_ftime ****/
- #define main() TEST__ftime()
-
- #include <types.h>
- #include <timeb.h>
- #include <time.h>
- #undef timezone
- #include <stdio.h>
- #include <stdlib.h>
-
- void main() {
- struct timeb x;
-
- puts("Testing _ftime...\n");
- _ftime(&x);
- printf("daylight is:%d\n"
- "timezone is:%d\n"
- "time is:%ld\n",
- x.dstflag,x.timezone,x.time);
- printf("time is:%ld\n",time(NULL));
- tzset();
- _ftime(&x);
- printf("daylight is:%d\n"
- "timezone is:%d\n"
- "time is:%ld\n",
- x.dstflag,x.timezone,x.time);
- printf("time is:%ld\n",time(NULL));
- }
-
- /* End _ftime */
- #undef main
- /**** name=fwrite ****/
- #define main() TEST_fwrite()
- /* End fwrite */
- #undef main
- /**** name=_gcvt ****/
- #define main() TEST__gcvt()
-
- /*
- This program converts a number to a string.
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #define BIG -2273734834873.2222
-
- void main() {
- char *result; /* _gcvt return string. */
- char buffer[100]; /* Buffer for result. */
-
- result = _gcvt(BIG, 10, buffer);
- printf("------- _gcvt test --------\n");
- printf(" value: %lf\n", BIG);
- printf(" resulting string: %s\n ", result);
- }
-
- /* End _gcvt */
- #undef main
- #undef BIG
- /**** name=getc ****/
- #define main() TEST_getc()
-
- /*
- This program copies test.dat character by character to getc.tmp. This
- example illustrates the use of getc and putc. Similar examples appear
- for fgetc and getchar, showing how the functions differ.
- */
-
- #include <stdio.h>
-
- void main() {
- FILE *FP1, *FP2;
-
- if ((FP1 = fopen("test.dat", "r")) == NULL)
- perror("Cannot open test.dat.");
- if ((FP2 = fopen("getc.tmp", "w")) == NULL)
- perror("Cannot open getc.tmp.");
- while (feof(FP1) == 0)
- fputc(fputchar(getc(FP1)), FP2);
- }
-
- /* End getc */
- #undef main
- /**** name=_getchX ****/
- #define main() TEST__getchX()
-
- #include <conio.h>
- #include <stdio.h>
-
- void main() {
- int c;
-
- puts("Every other character you key"
- " will be displayed.");
- do {
- c = _getche();
- if (c != '\r')
- c = _getch();
- } while (c != '\r');
- }
-
- /* End _getch* */
- #undef main
- /**** name=getchar ****/
- #define main() TEST_getchar()
-
- /*
- This program copies standard input character by character to getchar.tmp
- and to standard output. Similar examples are given for fgetc and getc,
- pointing out the differences among the functions.
- */
- #include <stdio.h>
- #undef getchar /* Undefine macros and access */
- #undef putchar /* the named functions. */
- void main() {
- FILE *FP1;
-
- printf("Enter characters; end with a period.\n");
- if ((FP1 = fopen("getchar.tmp", "w")) == NULL)
- perror("Cannot open getchar.tmp.");
- while ('.' != fputc(putchar(getchar()), FP1));
- }
- /* End getchar */
- #undef main
- /**** name=_getcwd ****/
- #define main() TEST__getcwd()
-
- /*
- This program gets the current working directory.
- */
-
- #include <stdio.h>
- #include <direct.h>
-
- void main() {
- char *cwd = NULL;
- int maxlen = 66;
-
- if ((cwd = _getcwd(cwd, maxlen)) != NULL)
- printf("Current working directory: %s\n", cwd);
- else
- perror("Error in _getcwd.");
- }
-
- /* End _getcwd */
- #undef main
- /**** name=getenv ****/
- #define main() TEST_getenv()
-
- /*
- This program displays the value of the IPATH environment variable.
- */
- #include <stdio.h>
- #include <stdlib.h>
- void main() {
- char *ev;
- if ((ev = getenv("IPATH")) != NULL)
- printf("The value of IPATH is:\n%s", ev);
- else puts("The IPATH variable is not set.\n");
- }
-
- /* End getenv */
- #undef main
- /**** name=_getpid ****/
- #define main() TEST__getpid()
-
- /*
- This program displays the caller's process ID.
- */
-
- #include <process.h>
- #include <stdio.h>
-
- void main() {
- printf("The process ID is: %d\n", _getpid());
- }
-
- /* End _getpid */
- #undef main
- /**** name=gets ****/
- #define main() TEST_gets()
-
- /*
- The program below copies a line from standard input to standard output.
- It illustrates the use of gets and puts.
- */
-
- #include <stdio.h>
- #define LINESIZE (256)
-
- void main() {
- char line[LINESIZE];
-
- printf("\nWaiting for keyboard input: ");
- if (gets(line))
- puts(line);
- }
-
- /* End gets */
- #undef main
- #undef LINESIZE
- /**** name=gmtime ****/
- #define main() TEST_gmtime()
- /* End gmtime */
- #undef main
- /**** name=HUGE_VAL ****/
- #define main() TEST_HUGE_VAL()
-
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- void main() {
- double x = 1.0;
- int counter;
-
- for (counter = 1; counter < 10000; (counter += 20)) {
- printf("\n%d\t%g", counter, exp(x));
- if (exp(x) >= HUGE_VAL) {
- printf(".....Number too big. Bye.\n");
- break;
- }
- x += counter;
- }
- printf("\nDone.");
- }
-
- /* End HUGE_VAL */
- #undef main
- /**** name=_hypot ****/
- #define main() TEST__hypot()
-
- #include <math.h>
- #include <stdio.h>
-
- void main() {
- double base=3.0, height=4.0;
-
- puts("Testing _hypot...\n");
- printf("Base => %.2f, Height => %.2f,"
- " Hypotenuse => %.2f\n",
- base,height,_hypot(base,height));
- base = 1.0, height = 1.0;
- printf("Base => %.2f, Height => %.2f,"
- " Hypotenuse => %.2f\n",
- base,height,_hypot(base,height));
- base = 8.0, height = -6.0;
- printf("Base => %.2f, Height => %.2f,"
- " Hypotenuse => %.2f\n",
- base, height, _hypot(base, height));
- }
-
- /* End _hypot */
- #undef main
-
- /*****names*****/
-
- char * names[]={
- "fabs",
- "fclose",
- "_fcvt",
- "ferror",
- "fgetc",
- "fgetpos",
- "fgets",
- "_filelength",
- "_fileno",
- "_fmalloc",
- "_FP_X",
- "fprintf",
- "fread",
- "freopen",
- "frexp",
- "fscanf",
- "fseek",
- "_ftime",
- "_gcvt",
- "getc",
- "_getchX",
- "getchar",
- "_getcwd",
- "getenv",
- "_getpid",
- "gets",
- "HUGE_VAL",
- "_hypot",
- "",""};
- int nextfunum;
- void main() {
- char ans[90];
- for (;;) {
- for (int j=0;j< 28;j++)
- if (j%3==2) printf("%4d %-21s\n",j+1,names[j]);
- else printf("%4d %-21s",j+1,names[j]);
- printf("\n\nPlease enter a number from the above list (enter=%d, exit=0): ",++nextfunum);
- gets(ans);
- if (ans[0] != 0) nextfunum=atoi(ans);
- printf("\n\n\n");
- switch(nextfunum) {
- case 0:exit(0);
- case 1:TEST_fabs();break;
- case 2:TEST_fclose();break;
- case 3:TEST__fcvt();break;
- case 4:TEST_ferror();break;
- case 5:TEST_fgetc();break;
- case 6:TEST_fgetpos();break;
- case 7:TEST_fgets();break;
- case 8:TEST__filelength();break;
- case 9:TEST__fileno();break;
- case 10:TEST__fmalloc();break;
- case 11:TEST__FP_X();break;
- case 12:TEST_fprintf();break;
- case 13:TEST_fread();break;
- case 14:TEST_freopen();break;
- case 15:TEST_frexp();break;
- case 16:TEST_fscanf();break;
- case 17:TEST_fseek();break;
- case 18:TEST__ftime();break;
- case 19:TEST__gcvt();break;
- case 20:TEST_getc();break;
- case 21:TEST__getchX();break;
- case 22:TEST_getchar();break;
- case 23:TEST__getcwd();break;
- case 24:TEST_getenv();break;
- case 25:TEST__getpid();break;
- case 26:TEST_gets();break;
- case 27:TEST_HUGE_VAL();break;
- case 28:TEST__hypot();break;
- default:printf("I don't recognize that answer\n");nextfunum=-1;break;
- }
- printf("\n\npress enter to select another function\n");
- gets(ans);
- }
- }
-