Using a variable before intialization (or assignment) is serious cause of errors. You can not reliably check it at runtime, but you can detect it during or before compilation.
I suggest not to check it inside the code. Because this is likely to cause compiler warnings (Variable 'i' is used before it has been assigned a value), introduce new errors and has very little chance on succes in medium to large programs.
The best method is to use static code analys tools (like QA/C or PCLint).
Using compiler at high warning sensitivity level is a free option, with much less coverage as the specialized tools.
If you perform code reviews, you can also include a check for uninitialized variables on the checklist. This is no guarantee, but it will trigger manual checks from reviewers.
If it is runtime checking you want, then you can start of by intializing variables to an out-of-range value. For instance -1 for an otherwise postive value. Then you can check for
#define UNASSIGNED_VALUE -1
static int number_of_apples = UNASSIGNED_VALUE;
if (UNASSIGNED_VALUE == number_of_apples)
{
// error handling
}
this is not a true 'unintialized' variable, but at least you can detect whether runtime assignments in legal range were done.