I have something like this:
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void shortestRemainingTime(map<string, string> processes[]){
int size = (sizeof(processes)/sizeof(*processes));
cout << size;
}
int main() {
map<string, string> process { { "name", "open paint" }, { "remainingTime", "1000" } };
map<string, string> process2{ { "name", "open photoshop" }, { "remainingTime", "500" } };
map<string, string> process3{ { "name", "open word" }, { "remainingTime", "600" } };
map<string, string> processes[] = {process, process2, process3};
shortestRemainingTime(processes);
return 0;
}
For now, I'm not making any calculation in shortestRemainingTime
but, when I print the size of the array of the map processes
, I'm getting 0, which isn't right.
How can I get the right length of this special array?
map<string, string> processes[] = {process, process2, process3};