Although I use it std::vectoralmost all the time, I am interested in understanding as many pointers as possible. Examples of what I'm talking about:
std::vector
char* array[5]; // What does it mean? // 1) pointer to an array of 5 elements! // 2) an array of 5 pointers?
I am interested in the exact definition of this declaration.
Not just pointers and arrays: How to interpret complex C / C ++ declarations :
Start reading the declaration with the innermost parentheses, go right, and then go left. When you encounter brackets, the direction should be the other way around. As soon as everyone in the parentheses sorted out, jumped out of this. Continue until the whole declaration has been analyzed.: , .
Start reading the declaration with the innermost parentheses, go right, and then go left. When you encounter brackets, the direction should be the other way around. As soon as everyone in the parentheses sorted out, jumped out of this. Continue until the whole declaration has been analyzed.
: , .
:
char* array[5];
5 char.
cdecl - , . ( !)
Type `help' or `?' for help cdecl> explain char* foo[5] declare foo as array 5 of pointer to char cdecl> declare bar as array 5 of pointer to function (integer, integer) returning char char (*bar[5])(int , int )
/ - . -, :
, , .
C/++:
"char * array [5]", - "", - [] (), * ().
" , ".
" " array ", , char".
, " ", , , char "
, , [] () , *. , .
char * - , 5 .
[] , *, , .
, "*" . char ** a [5] - 5 ...
Source: https://habr.com/ru/post/1718957/More articles:Prevent password hint from providing password to the right - securityasp.net ajax 4.0 client templates, how to bind selection? - javascriptHow to make cronjobbable script to load hours? - scriptingCan I just pass the groovy markupbuilder a node list? - xmlMacros training schemes. Help me write a define-syntax rule - macrosDownload Sync Script - scriptingLink type and pointer when disassembling - c ++Disable java application from console / command window - javaHow do I know when I stopped scrolling a TScrollBar? - eventshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1718962/testing-real-repositories&usg=ALkJrhg588jMRljSBp_WzwZ8TGuELok3NAAll Articles