A sweep attack is a special kind of attack routine only available to fighters (and their subclasses).
Fighter-class characters fighting monsters of less than one hit die have a number of attack routines per round equal to their fighter class level, AKA sweep attacks1), rather than their regular number of attacks.2) Each sweep attack is an attack routine, meaning they are subject to the special initiative rules on DMG 62-63 (also detailed in the Combat Procedure.
A fighter cannot attack any combatant with 1 or more HD on the same round the fighter makes sweep attacks. Therefore, the player will likely need to declare intent to sweep attack during action declarations (see Combat Procedure), since doing so will affect initiative.
Weapon length always determines first strike on the charge, so even if a fighter would normally be able to sweep attack enemies who are charging him, weapon length is checked instead. Once both sides have rolled attacks when the charge is met, if the fighter has attacks remaining, the fighter may make those normally afterward.