This is bad form, even though it may technically correct.
A better way would be
function XYZ()
{
handle = fopen(myFile)
// some processing
// I am in the middle of the file
Call ABC(handle)
fclose(handle)
}
ABC (handle)
{
//do some processing on handle
}
And if your language supports a try-finally construct I highly recommend using that
ie:
function XYZ()
{
handle = fopen(myFile)
try
{
// some processing
// I am in the middle of the file
Call ABC(handle)
}
finally
{
fclose(handle)
}
}
ABC (FilePtr handle)
{
//do some processing on handle
}