Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!seismo!ut-sally!ut-ngp!infotel!pollux!bobkat!mike From: mike@bobkat.UUCP Newsgroups: comp.sys.atari.st Subject: sizeof literal string, Megamax bug Message-ID: <888@bobkat.UUCP> Date: Fri, 17-Apr-87 13:33:53 EST Article-I.D.: bobkat.888 Posted: Fri Apr 17 13:33:53 1987 Date-Received: Sun, 19-Apr-87 01:34:02 EST References: <639@batcomputer.tn.cornell.edu> <821@viper.UUCP> <826@viper.UUCP> Reply-To: mike@bobkat.UUCP (Mike Bunnell) Organization: Digital Lynx, Inc; Dallas, TX Lines: 25 Keywords: user-friendly C sizeof Well, you're right. A literal string is defined to be an array of char, which is then usually changed to a pointer to char when used. Sizeof(array) gives the size of the array, So sizeof("Hello"), should be 6. Note that the null at the end is included. I have just completed the new version of Megamax C, and I fixed that bug and a few others. More importantly the compiler now produces absolute references to code and data locations. Therefore, array sizes are no longer limited to 32K and code does not have to be split up in 32K segments. There is a 32 bit int switch to make porting code easier; There are two more address (pointer) registers available; Shorts are 16 bits like they always should have been; enumerated types are supported; and many other minor fixes and impovements have been made. The new linker accepts either UN*X a.out format object files or DRI (Alcyon) format object files. It is extremely fast. Even though the compiler is a little slower (do to backpatching necessary for new object file format) the linker more than makes up for it even when compiling thousands of lines of code. Megamax is still testing the new version, but it should be out soon. Happy programming, Mike Bunnell P.S. I don't handle tech support anymore. Ask for Pete.