online-caro.cpp
/*
* Split the arguments into an array of characters and an array of digits.
* @param     args    [IN] the string arguments.
* @param     chars     [OUT] the array of characters.
* @param     chars     [OUT] the array of digits.
*/
Split the arguments into an array of characters and an array of digits.
Split the arguments into an array of characters and an array of digits .
void splitCharsAndDigits(char* args, char* chars, char* digits) {
	int charsCounter = 0, numsCounter = 0;
	for (int i = 0; i < strlen(args); i++) {
		if ((int('A') <= int(toupper(args[i])) && int(toupper(args[i])) <= int('Z'))) {
			chars[charsCounter] = args[i];
			charsCounter++;
		}
		else if ((int('0') <= int(args[i]) && int(args[i]) <= int('9'))) {
			digits[numsCounter] = args[i];
			numsCounter++;
		}
	}
}
void splitCharsAndDigits ( char * args , char * chars , char * digits ) { int charsCounter = 0 , numsCounter = 0 ; for ( int i = 0 ; i < strlen ( args ) ; i ++ ) { if ( ( int ( ' ' ) <= int ( toupper ( args [ i ] ) ) && int ( toupper ( args [ i ] ) ) <= int ( ' ' ) ) ) { chars [ charsCounter ] = args [ i ] ; charsCounter ++ ; } else if ( ( int ( ' ' ) <= int ( args [ i ] ) && int ( args [ i ] ) <= int ( ' ' ) ) ) { digits [ numsCounter ] = args [ i ] ; numsCounter ++ ; } } }
Split the arguments into an array of characters and an array of digits.
Split the arguments into an array of characters and an array of digits .