▁compile - time ▁and ▁perhaps ▁runtime ▁errors . ▁ ▁Consider ▁the ▁following ▁program ▁of ▁a ▁language ▁that ▁is ▁both ▁type - safe ▁and ▁memory - safe : ▁ ▁var ▁x ▁:= ▁ 5 ; ▁▁▁ ▁var ▁y ▁:= ▁" 3 7 "; ▁ ▁var ▁z ▁:= ▁x ▁+ ▁y ; ▁▁ ▁In ▁this ▁example , ▁the ▁variable ▁ ▁will ▁have ▁the ▁value ▁ 4 2 . ▁Although ▁this ▁may ▁not ▁be ▁what ▁the ▁programmer ▁anticip ated , ▁it ▁is ▁a ▁well - defined ▁result . ▁If ▁ ▁were ▁a ▁different ▁string , ▁one ▁that ▁could ▁not ▁be ▁converted ▁to ▁a ▁number ▁( e . g . ▁" Hello ▁World "), ▁the ▁result ▁would ▁be ▁well - defined ▁as ▁well . ▁Note ▁that ▁a ▁program ▁can ▁be ▁type - safe ▁or ▁memory - safe ▁and ▁still ▁crash ▁on ▁an ▁invalid ▁operation ; ▁in ▁fact , ▁if ▁a ▁program ▁enc oun ters ▁an ▁operation ▁that ▁is ▁not ▁type - safe , ▁termin ating ▁the ▁program ▁is ▁often ▁the ▁only ▁option . ▁ ▁Now ▁consider ▁a ▁similar ▁example ▁in ▁C : ▁ ▁int ▁x ▁= ▁ 5 ; ▁char ▁y [] ▁= ▁" 3 7 "; ▁char * ▁z ▁= ▁x ▁+ ▁y ; ▁ ▁In ▁this ▁example ▁ ▁will ▁point ▁to ▁a ▁memory ▁address ▁five ▁characters ▁beyond ▁, ▁equivalent ▁to ▁three ▁characters ▁after ▁the ▁termin ating ▁zero ▁character ▁of ▁the ▁string ▁pointed ▁to ▁by ▁. ▁This ▁is ▁memory ▁that ▁the ▁program ▁is ▁not ▁expected ▁to ▁access . ▁It ▁may ▁contain ▁garbage ▁data , ▁and ▁it