home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list17_1.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-10-16
|
432 b
|
24 lines
/* Using the strlen() function. */
#include <stdio.h>
#include <string.h>
main()
{
size_t length;
char buf[80];
while (1)
{
puts("\nEnter a line of text; a blank line terminates.");
gets(buf);
length = strlen(buf);
if (length != 0)
printf("\nThat line is %u characters long.", length);
else
break;
}
}