template
void prettyPrint(T value, char* buf);
now assume that you are using sprintf for formatting the input .
that being the case you can use template specializations like this :
template<> void prettyPrint
sprintf(buf, "%d", value);
}
template<> void prettyPrint
sprintf(buf, "%c", value);
}
No comments:
Post a Comment