Cyclone (programming language): Difference between revisions

Content deleted Content added
m more footnotes
m Pointer types: {{code}}
Line 83:
}
</syntaxhighlight>
This function assumes that the string being passed in is terminated by {{code|NULL}} (<code>'\0'</code>). However, what would happen if <{{code>|style=white-space:nowrap|2=c|1=char&nbsp; buf[6]&nbsp; =&nbsp; {'h','e','l','l','o','!'};</code>}} were passed to this string? This is perfectly legal in C, yet would cause <code>strlen</code> to iterate through memory not necessarily associated with the string <code>s</code>. There are functions, such as <code>strnlen</code> which can be used to avoid such problems, but these functions are not standard with every implementation of [[ANSI C]]. The Cyclone version of <code>strlen</code> is not so different from the C version:
<syntaxhighlight lang="C">
int strlen(const char ? s)