Array is a data type, double is an array element type, and 4 is the number of array elements
Array<double, 4> dbnew1 = {10.1,10.2,10.3,10.4};
The new version of the array allows for overall operation
Rray<double, 4> dbnew2 = Dbnew1;
1#include <iostream>2#include <array>3 using namespacestd;4 5 voidMain ()6 {7 Doubledb[4] = {1.1,2.2,3.3,4.4 };8 9 //Array is a data type, double is an array element type, and 4 is the number of array elementsTenarray<Double,4> dbnew1 = {10.1,10.2,10.3,10.4 }; Onearray<Double,4> dbnew2 = dbnew1;//The new version of the array allows for overall operation A - for(inti =0; I <4; i++) - { thecout << Db[i] <<" "; - } - -cout <<Endl; + - for(inti =0; I <4; i++) + { Acout << Dbnew1[i] <<" "; at } - -cout <<Endl; - - for(inti =0; I <4; i++) - { incout << Dbnew2[i] <<" "; - } to +System"Pause"); -}
Prints the string and executes
Using the C_STR function
System (STRING1[I].C_STR ());
1#include <iostream>2#include <array>3#include <string>4 using namespacestd;5 6 voidMain ()7 {8array<string,5> string1 = {"Calc","Notpad","tasklist","MSPaint","Write" };9 Ten for(inti =0; I <5; i++) One { Acout << String1[i] <<Endl; - System (STRING1[I].C_STR ()); - } the -System"Pause"); -}
string addition, C-like strcat function
1#include <iostream>2#include <array>3#include <string>4 using namespacestd;5 6 voidMain ()7 {8 stringSTR1 ="Task";9 stringSTR2 ="List";Ten stringSTR3 = str1 +str2; One A System (STR3.C_STR ()); - -System"Pause"); the}
#include <array>