[code] void alt_caps( char *aStr )
{
int i = 0;
while ( aStr[i] = (i%2) ? (tolower(aStr[i])) ; (toupper(aStr[i])) )
++i;
}[/quote]
That assumes you're passing a pointer to a buffer which can be changed. If not, you'll probably want to return a pointer to some memory allocated on the heap, or return a pointer to a static variable.
|