Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!marvin.e17.physik.tu-muenchen.de!berg From: berg@marvin.e17.physik.tu-muenchen.de (Stephen R. van den Berg) Newsgroups: comp.lang.c Subject: increment casted void pointer -- ANSI? Message-ID: <4142@rwthinf.UUCP> Date: 8 Mar 91 15:22:38 GMT Sender: news@rwthinf.UUCP Lines: 25 Suppose I have the following (silly example, I know :-) program: #include main(){static char s[]="abcd";void*p;int a,b; p=s; a=*(char*)p; b=*++(char*)p; *--(char*)p=b; *++(char*)p=a; puts(s); return 0;} Now, you tell me if this is ANSI or K&R or neither, and if it's not ANSI, how do I do it in ANSI then? I always thought this was ANSI code, but there seems to be some compiler on an IBM RT that says otherwise. Thanks. -- Sincerely, berg@marvin.e17.physik.tu-muenchen.de Stephen R. van den Berg. "I code it in 5 min, optimize it in 90 min, because it's so well optimized: it runs in only 5 min. Actually, most of the time I optimize programs."