Just contacted C, array declaration problem

Can

C declare dynamic arrays? As far as I know, it doesn"t work. You must specify size
. For example, the following will report an error

.
string name[];

then the parameters of, command line implement the declaration of dynamic array in the following main function

int main(int argc, string argv[])
{

}

Please advise

C
Mar.19,2021

the [] that appears in the parameters of the function is actually a pointer.
is equivalent to int main (int argc, string * argv) in terms of the example you gave


The

array can be thought of as the syntax sugar of the pointer to some extent. So the dynamic array is actually

.
char *name = malloc(100);

// when you need to extend your string
name = realloc(name, 200);
The length of

argv is actually similar to that of a string, which is marked by the last '\ 0' . You can imagine that the system realloc has just enough memory.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e59aa0-45552.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e59aa0-45552.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?