sprintf("%d", max(long, float));
Why don't you just juggle torches while you gas up your car?
First, you're short an argument to sprintf - you forgot the destination buffer.
Second, the xxxxf family (scanf, printf, and their variants), have no place in C++.
Use strstreams.
char buffer[50];
ostrstream ost(buffer,sizeof(buffer));
ost << (max(aLong, aFloat)) << ends;