Re: Is there an end of string like in C
Chris L wrote:
In C, there is an end of string character ('\0'). Is there one in Ada?
No, this is a C specialty - and also a typical nuisance of C...
In Ada you know the array bounds, and a string is an array of Character.
Can you give me code that checks for it in an array?
s'Length give you the string length, without any loop, or the risk of
a missing end-of-string character.
Thank you,
Christopher Lusardi
HTH, Gautier
_______________________________________________________________
Ada programming --
http://www.mysunrise.ch/users/gdm/gsoft.htm
NB: For a direct answer, e-mail address on the Web site!
.
Relevant Pages
- Re: String literals and wide_string literals - how?
... But I'll bet it _seems_ weird to anyone who doesn't know Ada well. ... Character, or derived from it. ... And STRING as array of char, although it ... (comp.lang.ada) - Re: What is the best way to define the Imported C function
... I would suggest that you learn Ada before trying to interface it to C. ... But if you are going to do it, use the types in Interfaces.C and its children, or types declared Convention C, not String and Integer; and don't pass explicit pointer values when Ada's interfacing rules will do the right thing for you. ... we can't tell how to interface to it. ... procedure F (C: in out Character); ... (comp.lang.ada) - Re: Is there an end of string like in C
... You can define your own character types and your own string types. ... type String is array of Character; ... The C approach is referred to in Ada as a bounded string; the logical value can vary in length from zero to some maximum number of characters. ... (comp.lang.ada) - [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ... (Linux-Kernel) - RfD: Escaped Strings version 4
... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ... (comp.lang.forth) |
|