-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (28 loc) · 1.19 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include "ArrayStats.h"
#include <vector>
int main()
{
const std::vector<int> list1 = {3, 8, 5, 1, 2, 7, 3, 4};
ArrayStats::getStats(list1.begin(), list1.end()).print();
std::cout << std::endl;
const std::vector<int> list2 = {4, 3, 1, 7, 3, 8};
ArrayStats::getStats(list2.begin(), list2.end()).print();
std::cout << std::endl;
const int num = 4;
const int* list3 = #
ArrayStats::getStats(list3, list3+1).print();
std::cout << std::endl;
const int list4[] = {4, 8, 5, 1, 1, 2};
ArrayStats::getStats(&(list4[0]), &(list4[6])).print(); //I don't think the template likes arrays. This should be safe btw
std::cout << std::endl;
const int* list5 = list4;
ArrayStats::getStats(list5, list5 + 6).print(); //It should be fine with pointer arrays tho
return 0;
}