programminga general overview vector daysinmonth )/no {before ++ daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth daysinmonth certainly this leaves something to be desired ++ fixes this problem and allowsvector daysinmonth }requiring the in the initialization violates the spirit of uniform initializationsince now we would have to remember when it would be appropriate to use consequentlyc++ also allows (and some prefer)vector daysinmonth }with syntaxhowevercomes ambiguityas one sees with the declaration vector daysinmonth }is this vector of size or is it vector of size with single element in position ++ gives precedence to the initializer listso in fact this is vector of size with single element in position and if the intention is to initialize vector of size the old +syntax using parentheses must be usedvector daysinmonth )/must use (to call constructor that takes size string is also easy to use and has all the relational and equality operators to compare the states of two strings thus str ==str is true if the value of the strings are the same it also has length method that returns the string length as figure showsthe basic operation on arrays is indexing with [thusthe sum of the squares can be computed asint sum forint squares size)++ sum +squaresi ]the pattern of accessing every element sequentially in collection such as an array or vector is fundamentaland using array indexing for this purpose does not clearly express the idiom ++ adds range for syntax for this purpose the above fragment can be written instead asint sum forint squares sum +xin many casesthe declaration of the type in the range for statement is unneededif squares is vectorit is obvious that is intended to be an int thus ++ also allows the use of the reserved word auto to signify that the compiler will automatically infer the appropriate typeint sum forauto squares sum +