824,398 views
Vectors are one-dimensional homogeneous composite variables, as they can store several values of the same type in the same variable. A vector can have several internal spaces, identified by indexes. The correct way to declare a vector is in the following line: var V: vector (1..10) of Integer The line above will declare a variable V with 10 positions. To insert a value into the vector above, we can perform the following assignment: V(1) := 100 In the line above, the value 100 will be placed in position 1 of the vector V. We can also allow the user to type the values of each position, using any repetition structure. For example: For c := 1 to 10 do Write Type a value: Read V(c) EndFor The variable C in the excerpt above will be an integer value that will count each of the 10 positions. The user will type each of the 10 values and they will be stored in the vector. For more information on the use of vectors, with solved exercises and proposed exercises, watch this 42-minute class very carefully and be sure to practice a lot. Class from the Algorithms Course created by Professor Gustavo Guanabara for the portal CursoemVideo.com. Download packages and course with FREE certificate: http://cursoemvideo.com/course/curso-... Video Course Website: http://www.cursoemvideo.com YouTube: / cursosemvideo Facebook: / cursosemvideo Twitter: / cursosemvideo Google+: http://plus.google.com/11266655883741... HOSTNET Sponsorship: http://www.hostnet.com.br