lelouch didn't die, notice how when nunnally touched lelouch and she saw his memories, the same implies when lelouch touched C.C and saw her memories. To obtain the code, you have to die first. Lelouch now has the code and is immortal
you have a point.