From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6ec0e822a8924768 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-19 23:17:11 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!usc!crash!telesoft!kst From: kst@alsys.com (Keith Thompson @pulsar) Subject: Re: C-Ada Import of struct's -- Help Message-ID: Sender: news@alsys.com (USENET News Admin @flash) Organization: Alsys Group, San Diego, CA, USA References: <9410181020.AA08716@eurocontrol.de> <3816kn$n4e@schonberg.cs.nyu.edu> Date: Thu, 20 Oct 1994 00:36:32 GMT Date: 1994-10-20T00:36:32+00:00 List-Id: In <3816kn$n4e@schonberg.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes: > "Also remember that a C string must be null terminated" > > be careful not to confuse here, there is no such requirement in C. > Certain C library routines (but by no means all) require strings to > be null terminated, and string constants are null terminated, but there > is no general requirement in C that corresponds to this quote. Not a requirement, but a definition. Section 7.1.1 of the ANSI C standard says A string is a contiguous sequence of characters terminated by and including the first null character. This is merely a small confusion of terminology, though. An Ada string is simply an array of characters (of a particular type). It is important to remember that a C array of characters (char[]) may or may not contain a "string"; a C pointer to [array of] character (char*) may or may not point to a "string". -- Keith Thompson (The_Other_Keith) kst@alsys.com TeleSoft^H^H^H^H^H^H^H^H Alsys, Inc. 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 /user/kst/.signature: I/O error (core dumped)