Download as pdf
Download as pdf
You are on page 1of 7
Vectors Hi) ‘Supported vector types entrant rh yu ey a Tse hpi by pean pon these deren a General vector declaration syntax In genera, a vector declaration consias of the following: element type_spsciter{vector length] Argument Description clement tyee_svecier __Atype specifier that denotes the data tyoe of the vector's elements. vector loneth ‘An expression anclesad within brackats thst spectios the length ofthe vector. For more information on syntax for declaring different types ef vectors, see the following topics: (© Deslaring data-sined vectors Declaring setesized vectors Related topics © Seferencing uactor alements ‘+ Creating ang intsising vecione + Populating vectors wth valuee ‘+ Aesgning valuce betwesn vactore of diferent cizes + Convertna data to tvae vector Declaring fixed-size vectors ‘The syntax tor declanna fxed-size vectors fellows, Nota thatthe square brackets eurrounding size are requiraé: ‘ype_spectier(sze] ‘Argument Description type_speciter The type ofthe vectors elements, see ‘An integer constant spectving the numberof elements in the vector. Examples: Declaring fixed-size vectors Three-element veetor of integers Given the folowing ram data: ThE [And the following vector decaraton,speofying 8 three-element vector of unsigned big-endian 2-byte integers: unsigned big endian integer(2) [2] OM reprecerte the data Ivector 276, 277, 278) Nested vestors NSN NS a EE EE Declaring a etdength vector of records as a record Fld ‘ibcry leona perso ser gener serotype beams arene non mn spe name Poona eon Declaring delimited vectors Yaa nse ltr cain ur i ig ie ny nb ode Examples: Declaring delimited vectors Zero-deliite vetors ‘See eon rahe eal een ck [adhe losing aor dara in whch ere of pe IEE el ar eed ison eaiisceer 8) String delimited vectors SW (Genser "egies "sn" "es" Declaring self-sized vectors Example: Declaring selfsized vectors Declaring length-prefixed vectors ‘Sere ecier Teton ae was nets Examples: Declaring length-prefixed vectors Vector wth decimal length prefix whos met ae ermedeimiedan en aon gh 6 treater) hfe en are eee Referencing vector elements cero ares cena 8808. ere vec sdbesoeson an exreson a evo 3 Vaz and nab sverDeson eros Vrs RH Verner BON Wt 8 cess mereceeltls ° ‘Forma ifermatn on lamar eas eit be Bess ures” Initializing vectors using the allocate_with_defaults function Example: ntazing vectors using allocate with fous og} Syntax ol) ea en ee) Detaie string_split string_split_no_empty

You might also like