I was wondering if it is possible to pass an integer as a precision specifier.
For example if
static void ShouldBeTruncated( char * StringToCheck, int precision )
{
(strlen( StringToCheck )>= precision) ? printf( "%.15s...", StringToCheck) : printf( "%s", StringToCheck) ;
}
Is it even possible to replace %.15s
with %.<<PRECISION GOES HERE >>s
so the length of precision could be specified ?
If it is possible, how to do it ?