prog.cpp:10:11: error: expected ‘)’ before ‘,’ token
node(str_, num_, doub_, x_) {
~ ^
)
prog.cpp:20:17: error: conflicting declaration ‘int arr [10000000]’
int arr[10000000];
^
prog.cpp:17:15: note: previous declaration as ‘std::array<int, 3> arr’
array<int, 3> arr; // -> {0, 0, 0}
^~~
prog.cpp:23:20: error: conflicting declaration ‘bool arr [100000000]’
bool arr[100000000];
^
prog.cpp:17:15: note: previous declaration as ‘std::array<int, 3> arr’
array<int, 3> arr; // -> {0, 0, 0}
^~~
prog.cpp: In function ‘int main()’:
prog.cpp:31:19: error: conflicting declaration ‘bool arr [10000000]’
bool arr[10000000];
^
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:36:10: error: ‘raj’ has not been declared
cout << raj::getVal() << endl; // prints 50
^~~
prog.cpp:39:2: error: expected primary-expression before ‘int’
int
^~~
prog.cpp:54:7: error: redeclaration of ‘node raj’
node raj = new node("striver", 79, 91.0, "");
^~~
prog.cpp:49:7: note: ‘node raj’ previously declared here
node raj;
^~~
prog.cpp:54:45: error: no matching function for call to ‘node::node(const char [8], int, double, const char [1])’
node raj = new node("striver", 79, 91.0, "");
^
prog.cpp:4:8: note: candidate: ‘node::node()’
struct node {
^~~~
prog.cpp:4:8: note: candidate expects 0 arguments, 4 provided
prog.cpp:4:8: note: candidate: ‘node::node(const node&)’
prog.cpp:4:8: note: candidate expects 1 argument, 4 provided
prog.cpp:4:8: note: candidate: ‘node::node(node&&)’
prog.cpp:4:8: note: candidate expects 1 argument, 4 provided
prog.cpp:57:7: error: expected primary-expression before ‘]’ token
{arr[], int, double};
^
prog.cpp:57:10: error: expected primary-expression before ‘int’
{arr[], int, double};
^~~
prog.cpp:64:16: error: conflicting declaration ‘std::array<int, 3> arr’
array<int, 3> arr; // -> {?, ?, ?}
^~~
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:67:16: error: conflicting declaration ‘std::array<int, 5> arr’
array<int, 5> arr = {1}; // -> {1, 0, 0, 0, 0}
^~~
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:70:15: error: conflicting declaration ‘int arr [10000]’
int arr[10000] = {0};
^
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:74:16: error: conflicting declaration ‘std::array<int, 5> arr’
array<int, 5> arr;
^~~
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:75:6: error: request for member ‘fill’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.fill(10); -> /// {10, 10, 10, 10, 10}
^~~~
prog.cpp:75:16: error: expected primary-expression before ‘->’ token
arr.fill(10); -> /// {10, 10, 10, 10, 10}
^~
prog.cpp:81:15: error: request for member ‘at’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.at(i) << " ";
^~
prog.cpp:90:16: error: conflicting declaration ‘std::array<int, 5> arr’
array<int, 5> arr = {1, 3, 4, 5, 6};
^~~
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:91:19: error: request for member ‘begin’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.begin(); it!=arr.end();it++) {
^~~~~
prog.cpp:91:26: error: expected ‘)’ before ‘;’ token
for(auto it: arr.begin(); it!=arr.end();it++) {
~ ^
)
prog.cpp:91:28: error: ‘it’ was not declared in this scope
for(auto it: arr.begin(); it!=arr.end();it++) {
^~
prog.cpp:91:28: note: suggested alternative: ‘int’
for(auto it: arr.begin(); it!=arr.end();it++) {
^~
int
prog.cpp:91:36: error: request for member ‘end’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.begin(); it!=arr.end();it++) {
^~~
prog.cpp:97:19: error: request for member ‘rbegin’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.rbegin(); it>arr.rend();it++) {
^~~~~~
prog.cpp:97:27: error: expected ‘)’ before ‘;’ token
for(auto it: arr.rbegin(); it>arr.rend();it++) {
~ ^
)
prog.cpp:97:36: error: request for member ‘rend’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.rbegin(); it>arr.rend();it++) {
^~~~
prog.cpp:101:19: error: request for member ‘end’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.end() - 1; it>=arr.begin();it--) {
^~~
prog.cpp:101:28: error: expected ‘)’ before ‘;’ token
for(auto it: arr.end() - 1; it>=arr.begin();it--) {
~ ^
)
prog.cpp:101:38: error: request for member ‘begin’ in ‘arr’, which is of non-class type ‘int [1000000]’
for(auto it: arr.end() - 1; it>=arr.begin();it--) {
^~~~~
prog.cpp:118:14: error: request for member ‘size’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.size();
^~~~
prog.cpp:121:14: error: request for member ‘front’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.front(); // arr.at(0);
^~~~~
prog.cpp:124:14: error: request for member ‘back’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.back(); // arr.at(arr.size() - 1);
^~~~
prog.cpp:131:12: error: conflicting declaration ‘int arr [50]’
int arr[50];
^
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:135:14: error: conflicting declaration ‘std::vector<int> arr’
vector<int> arr; // -> {}
^~~
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:136:14: error: request for member ‘size’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.size() << endl; // -> print 0
^~~~
prog.cpp:137:6: error: request for member ‘push_back’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.push_back(0); // {0}
^~~~~~~~~
prog.cpp:138:6: error: request for member ‘push_back’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.push_back(2); // {0,2}
^~~~~~~~~
prog.cpp:139:14: error: request for member ‘size’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.size() << endl; // -> print 2
^~~~
prog.cpp:140:6: error: request for member ‘pop_back’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.pop_back(); // {0}
^~~~~~~~
prog.cpp:141:14: error: request for member ‘size’ in ‘arr’, which is of non-class type ‘int [1000000]’
cout << arr.size() << endl; // print 1
^~~~
prog.cpp:143:6: error: request for member ‘push_back’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.push_back(0); // {0,0}
^~~~~~~~~
prog.cpp:144:6: error: request for member ‘push_back’ in ‘arr’, which is of non-class type ‘int [1000000]’
arr.push_back(2); // {0,0,2}
^~~~~~~~~
prog.cpp:147:2: error: ‘vec’ was not declared in this scope
vec.clear(); // --> erase all elements at once {}
^~~
prog.cpp:155:23: error: redeclaration of ‘std::vector<int> vec3’
vector<int> vec3(vec2);
^
prog.cpp:154:14: note: ‘std::vector<int> vec3’ previously declared here
vector<int> vec3(vec2.begin(), vec2.end()); // -> [)
^~~~
prog.cpp:159:14: error: conflicting declaration ‘std::vector<int> raj’
vector<int> raj;
^~~
prog.cpp:49:7: note: previous declaration as ‘node raj’
node raj;
^~~
prog.cpp:160:6: error: ‘struct node’ has no member named ‘push_back’
raj.push_back(1); // raj.emplace_back(1); // emplace_back takes lesser time than push back
^~~~~~~~~
prog.cpp:161:6: error: ‘struct node’ has no member named ‘push_back’
raj.push_back(3);
^~~~~~~~~
prog.cpp:162:6: error: ‘struct node’ has no member named ‘push_back’
raj.push_back(2);
^~~~~~~~~
prog.cpp:163:6: error: ‘struct node’ has no member named ‘push_back’
raj.push_back(5); // -> {1, 3, 2, 5}
^~~~~~~~~
prog.cpp:165:23: error: ‘struct node’ has no member named ‘begin’
vector<int> raj1(raj.begin(), raj.begin() + 2); // -> {1, 3}
^~~~~
prog.cpp:165:36: error: ‘struct node’ has no member named ‘begin’
vector<int> raj1(raj.begin(), raj.begin() + 2); // -> {1, 3}
^~~~~
prog.cpp:178:14: error: redeclaration of ‘std::vector<int> raj1’
vector<int> raj1;
^~~~
prog.cpp:165:14: note: ‘std::vector<int> raj1’ previously declared here
vector<int> raj1(raj.begin(), raj.begin() + 2); // -> {1, 3}
^~~~
prog.cpp:196:17: error: unable to deduce ‘auto&&’ from ‘vec’
for(auto vctr: vec) {
^~~
prog.cpp:197:16: error: unable to deduce ‘auto&&’ from ‘vctr’
for(auto it: vctr) {
^~~~
prog.cpp:220:19: error: conflicting declaration ‘std::vector<int> arr [4]’
vector<int> arr[4];
^
prog.cpp:27:6: note: previous declaration as ‘int arr [1000000]’
int arr[1000000];
^~~
prog.cpp:221:9: error: request for member ‘push_back’ in ‘arr[1]’, which is of non-class type ‘int’
arr[1].push_back(0);
^~~~~~~~~
prog.cpp:225:58: error: expected primary-expression before ‘vec’
vector<vector<vector<int>>> vec(10, vector<vector<int>> vec(20, vector<int> (30, 0));)
^~~
prog.cpp:225:87: error: expected primary-expression before ‘)’ token
vector<vector<vector<int>>> vec(10, vector<vector<int>> vec(20, vector<int> (30, 0));)
^