Here is code which is very simple will make you better understanding .
using (SPSite spSite = new SPSite("http://servername:Portnumber/"))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
SPList spList = spWeb.Lists["AgeRating"];
//Get all roles from the existing list
SPRoleAssignmentCollection coll = spList.RoleAssignments;
SPListCollection lists = spWeb.Lists;
// create new Generic list called "MyList"
if (!spWeb.Lists.Cast
{
spWeb.AllowUnsafeUpdates = true;
lists.Add("MyList", "My list Description", SPListTemplateType.GenericList);
spWeb.AllowUnsafeUpdates = false;
}
SPList targetList = spWeb.Lists["MyList"];
foreach (SPRoleAssignment role in coll)
{
targetList.BreakRoleInheritance(false);
spWeb.AllowUnsafeUpdates = true;
targetList.RoleAssignments.Add(role);
}
spWeb.AllowUnsafeUpdates = false;
}
}