View Single Post
Old Mar 20th, 2008, 8:49 PM   #16
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 648
Rep Power: 4 Jessehk is on a distinguished road
Re: How Do I Urlencode A String In C?

Quote:
Originally Posted by Sane View Post
It's C99. But I need things to be as compatible as possible.
It isn't, AFAIK. But even if it was (and I'm wrong), you could just do
c Syntax (Toggle Plain Text)
  1. isalpha(ch) || isdigit(ch)

According to my man-pages, all of the functions in ctype.h are actually macros that do table lookups. They're fairly efficient (probably more so than your function), and I don't see any reason to not use them.

__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote