# array

***

**1. Array of Integers**

```cpp
int arr[] = {1, 2, 3, 4, 5};
```

**2. Array of Doubles**

```cpp
double arr[] = {1.2, 2.3, 3.4, 4.5, 5.6};
```

**3. Array of Characters**

```cpp
char arr[] = {'a', 'b', 'c', 'd', 'e'};
```

**4. Array of Booleans**

```cpp
bool arr[] = {true, false, true, false, true};
```

**5. Array of Strings**

```cpp
string arr[] = {"apple", "banana", "cherry", "dog", "elephant"};
```

**6. Array of Pointers**

```cpp
int* arr[] = {&x, &y, &z};
```

**7. Array of Objects**

```cpp
class Student {
public:
  int age;
  string name;
};
Student arr[] = {Student(), Student()};
```

**8. Array of Structures**

```cpp
struct Point {
  int x;
  int y;
};
Point arr[] = {Point(), Point()};
```

**9. Array of Unions**

```cpp
union Data {
  int a;
  float b;
};
Data arr[] = {Data(), Data()};
```

**10. Array of Arrays**

```cpp
int arr[3][3] = {
  {1, 2, 3},
  {4, 5, 6},
  {7, 8, 9}
};
```

**11. Array of Functions**

```cpp
int (*arr[])(int) = {
  &func1,
  &func2,
  &func3
};
```

**12. Array of Iterators**

```cpp
vector<int> v;
vector<int>::iterator arr[] = {v.begin(), v.end()};
```

**13. Array of Lists**

```cpp
list<int> arr[] = {
  list<int>(),
  list<int>()
};
```

**14. Array of Maps**

```cpp
map<int, string> arr[] = {
  map<int, string>(),
  map<int, string>()
};
```

**15. Array of Sets**

```cpp
set<int> arr[] = {
  set<int>(),
  set<int>()
};
```

**16. Array of Queues**

```cpp
queue<int> arr[] = {
  queue<int>(),
  queue<int>()
};
```

**17. Array of Stacks**

```cpp
stack<int> arr[] = {
  stack<int>(),
  stack<int>()
};
```

**18. Array of Trees**

```cpp
class Tree {
public:
  int data;
  Tree* left;
  Tree* right;
};
Tree* arr[] = {new Tree(), new Tree()};
```

**19. Array of Graphs**

```cpp
class Graph {
public:
  int numVertices;
  int numEdges;
  vector<vector<int>> adjList;
};
Graph arr[] = {Graph(), Graph()};
```

**20. Array of Exceptions**

```cpp
class Exception {
public:
  string message;
};
Exception arr[] = {Exception(), Exception()};
```

**21. Array of Bitsets**

```cpp
bitset<8> arr[] = {
  bitset<8>(),
  bitset<8>()
};
```

**22. Array of Regexes**

```cpp
regex arr[] = {
  regex(),
  regex()
};
```

**23. Array of Files**

```cpp
ifstream arr[] = {
  ifstream(),
  ifstream()
};
```

**24. Array of Streams**

```cpp
ostringstream arr[] = {
  ostringstream(),
  ostringstream()
};
```

**25. Array of Threads**

```cpp
thread arr[] = {
  thread(),
  thread()
};
```

**26. Array of Mutexes**

```cpp
mutex arr[] = {
  mutex(),
  mutex()
};
```

**27. Array of Condition Variables**

```cpp
condition_variable arr[] = {
  condition_variable(),
  condition_variable()
};
```

**28. Array of Semaphores**

```cpp
semaphore arr[] = {
  semaphore(),
  semaphore()
};
```

**29. Array of Barriers**

```cpp
barrier arr[] = {
  barrier(),
  barrier()
};
```

**30. Array of Atomic Integers**

```cpp
atomic<int> arr[] = {
  atomic<int>(),
  atomic<int>()
};
```

**31. Array of Atomic Floats**

```cpp
atomic<float> arr[] = {
  atomic<float>(),
  atomic<float>()
};
```

**32. Array of Atomic Booleans**

```cpp
atomic<bool> arr[] = {
  atomic<bool>(),
  atomic<bool>()
};
```

**33. Array of Atomic Characters**

```cpp
atomic<char> arr[] = {
  atomic<char>(),
  atomic<char>()
};
```

\*\*3
