Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tus88
· 6y ago · 0 comments
> Conflating pointers with arrays.
AND Strings.
FTFY.
Comments
[–]
yarrel
6y ago
C doesn't have strings. ;-)
[–]
Snarwin
6y ago
More precisely, it doesn't have a string
type
.
[–]
Skunkleton
6y ago
It certainly has string literals, which are a kind of type.
[–]
mark-r
6y ago
That's the thing, they're not a type - they're just an array of char with an unspecified length, indistinguishable from any other array of char or pointer to char. Only the convention of ending them with a null character makes them usable at all.
[–]
tus88
OP
6y ago
That's because they were conflated with both arrays and pointers.