Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!srcsip!pompeii!sklee From: sklee@pompeii.SRC.Honeywell.COM (Sungkee Lee) Newsgroups: comp.lang.c Subject: register variable??? Message-ID: <30585@srcsip.UUCP> Date: 8 Sep 89 16:35:32 GMT Sender: news@src.honeywell.COM Reply-To: sklee@srcsip.UUCP () Organization: Honeywell Systems & Research Center, MPLS, MN Lines: 28 #include int list[5] = {0, 1, 2, 3, 4}; main() { register int i; printf("list = %d %d %d %d %d\n", list[0], list[1], list[2], list[3], list[4]); i = 0; while (i < 4) list[i] = list[++i]; printf("list = %d %d %d %d %d\n", list[0], list[1], list[2], list[3], list[4]); } Above program gave me the result, list = 0 1 2 3 4 list = 0 1 2 3 4. However, if I define "int i" instead of "register int i", the result is list = 0 1 2 3 4 list = 1 2 3 4 4. Is this the way register variable is designed? Or, is this compiler error? I ran this program on Sun 3/60?