FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
February 01, 2006

Validating C and C++ for Safety and Security

(Page 2 of 8)

February, 2006: Validating C and C++ For Safety and Security

Example 1: hbAssignCodes() function.

void hbAssignCodes(
  int *code, unsigned char *length,  
  int minLen, int maxLen, int alphaSize )  {  
  int n, vec, i;  
  vec = 0;  
  for (n = minLen; n <= maxLen; n++) {  
    for (i = 0; i < alphaSize; i++)  
      if (length[i] == n) { code[i] = vec; vec++; };  
        vec <<= 1;  
  }  
}

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK