reading a cpp file

I need to find all the methods in a cpp file ... using shell script

Pls guide me regarding the grep criteria for searching methods

I mean what are the patterns to be grepped in *.cpp which match methods

Hope i have made myself clear

Thanks and Regards

-- Ultimatix

what have you tried so far..

could you share ...

Thanks
Sha

what i have done is sorted the *.cpp file according to latest timestamp using find command. i hv soted rthe value of latest path in a variable .. and then
cd variable name ie going to that path where latest version of cpp is stored.

then I need to grep for methods like publi , private etc..

pls help me in deciding the grep pattern