The standard string.h
header file does not define a data type called string
, it provides functions for manipulating C-style strings, which are null-terminated character arrays.
For example, you can do something like:
#include <stdio.h>
#include <string.h>
int main(void) {
char *myName = "paxdiablo";
printf("Length of '%s' is %zu
", myName, strlen(myName));
return 0;
}
Note the string in that code, it's a pointer to the paxdiablo
string literal, not some string
type that the standard does not provide.
C++ does provide a std::string
type but that's in the C++ string
header rather than the C string.h
. In any case, it doesn't appear from their web presence that CCS provides a C++ compiler, instead focusing on the C market.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…