I need to know how to make a list of lists, something like in python and dictionaries, where they gave you an entry and returned the values. In other examples, something like creating a list of students and each student having their average A and their average B. (Student -- [average A , average B]. With that data then, based on user input, print the value and either averageA or averageB. An input like:
input:
Student: Pedro
Output:
AverageA: 15
AverageB: 17
From my program I tried doing this but it only gives me an error.
#include <iostream>
#include <iomanip>
using namespace std;
void azar(int planetas[]){
}
int main(){
int planetas; int Mercurio[2] = {0.5, 0.3};
int** sistema = new int*[planetas];
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
sistema[i][j] = Mercurio;
cout << sistema[i][j];
}
}
}
A 2-dimensional array is in a way an array within an array. Each position of the first index of the array contains an array inside.
That is, assuming var[x][y], for X = 0, there is a number N possible for Y. X being a reference to the student and N being the number of averages for the student.
Cheers