use a const_iterator for a const list
Contact return_function(const list<Contact> &listOf, int index) {
for(list<Contact>::const_iterator it = listOf.begin(); it != listOf.end(); it++){
}
return Contact(); //dummy return
}
Edit. fixed the function name as pointed by others...