The user sent a response saying:
So, take Hashthe link
void topWords(Hash const& t, std::string const& word, std::string* topA);
Besides,
string[] not a type in C ++- ...
The original function sent by the questionnaire looks like this:
void topWords(Hash t, string word, string topA[]);
I know that in Java the syntax for declaring an array is:
int[] anArray;
whereas in C ++ this is:
int anArray[someNumber];
I suspect this refers to the defendant, but perhaps they meant something else. So I consulted with n3337 :
formatting note: unnecessary things are omitted, new lines are added for readability
§ 8.3.4 [dcl.array]
1 In the ad T D, where it Dhas the form
D1 [constant expression opt ] Attribute specifier-cl <sub> non-automatic sub>
T D1 "-declarator-type-list T", of D - ;
...
T ;
...
(5.19), . ( ) . N, N 0 N-1, D "----" N T ".
...
, , , D " array-declarator-type-list-array T ", . " array-type-list-type-list-type-list-type-type-list-type-type-type-type-type-type-type-type "array-declarator-type-list-array" T ", . 3.9.
...
anArray someNumber int. topA pointer to std::string. ?
, . , , . Java vs ++ , , string[] .
§3.9/6:
... , , ; ( " T" " N T" ) - ... [ :
extern int arr[];
, arr .