Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!diamond!jdm5548 From: jdm5548@diamond.tamu.edu (James Darrell McCauley) Newsgroups: comp.lang.c Subject: execution out of order ? Message-ID: <6687@helios.TAMU.EDU> Date: 19 Jul 90 04:04:31 GMT Sender: news@helios.TAMU.EDU Reply-To: jdm5548@diamond.tamu.edu (James Darrell McCauley) Organization: Texas A&M University Agricultural Engineering Department Lines: 26 What generally causes instructions to be executed out of order? This occurred once while over stepping the bounds of an array (and I assume writing in memory locations where instructions are stored), but I don't believe that is the case for my current problem. Specifically, what would cause the following? /* instructions */ /* script of execution */ main() % gcc main.c { % a.out ... *Christ fgetc(stdin); *comes printf("*Christ\n"); ^M^M ... *first printf("*comes\n"); % fgetc(stdin); % printf("*first\n"); } I get the same results with getchar(). This may be a FAQ and/or reflect my own ignorance, so in an effort to avoid negative comments, please E-mail any suggestions. Thanks. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - James Darrell McCauley jdm5548@diamond.tamu.edu Dept of Ag. Engineering (409) 845-6484 Texas A&M University, College Station, Texas 77843-2117, USA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -