| iMatix home page
| << | < | > | >>
Version 2.11



#include "sflstr.h"
char *
soundex (
    const char *string)


Calculates the SOUNDEX code for the string. Returns the address of a static area that holds the code. This area is overwritten by each call to the soundex function. The SOUNDEX encoding converts letters to uppercase, and translates each letter according to this table: A0 B1 C2 D3 E0 F1 G2 H0 I0 J2 K2 L4 M5 N5 O0 P1 Q2 R6 S2 T3 U0 V1 W0 X2 Y0 Z2. Non-letters are ignored, letters that translate to zero, and multiple occurences of the same value are also ignored. This function always returns a 4-letter encoding: the first letter of the string followed by the first three significant digits.


    printf ("Soundex of %s = %s\n", argv [1], soundex (argv [1]));

Source Code - (sflstr.c)

    ASSERT (string);
    return (soundexn (string, 4, FALSE));

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation