home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_07_08
/
v7n8013a.txt
< prev
next >
Wrap
Text File
|
1989-10-02
|
764b
|
39 lines
*****Listing 3*****
#include <stdio.h>
void trace1(const char *filename, int line)
{
static unsigned int counter = 0;
++counter;
fprintf(stderr, "T1 %3u: file: %s, line: %d\n",
counter, filename, line)
{
static unsigned int counter = 0;
++counter;
fprintf(stderr, "T2 %3u: file: %s, line: %d\n\n",
counter, filename, line);
}
The output produced from this version is:
T1> 1: file: t1l.c, line: 11
inside f
T2> 1: file: t1.c, line: 11
T1> 2: file: t1g.c, line: 7
inside f
T2> 2: file: t1g.c, line: 7
T1> 3: file: t1.c, line: 13
inside f
T2> 3: file: t1.c, line: 13
where T1 and T2 indicate the output from trace1 and trace2, respectively.
*******************