Hi There, I had a multidimentional array with values. I wanted to convert it into JSON I tried it with : `json=JSON.stringify(skill_array);` But it gave me output as below: [["Language","C++","0","1","May 2014","ascasc"],["DataBase","C++","0","1","May 2014","ascasc"],["Language","C++","0","1","May 2014","ascasc"]] SO how can i convert it into JSON? in Javascript

Member Avatar
Member Avatar
+0 forum 1

Hey guys, learning about multi-dimensional arrays and am tracing a code that my teacher gave us, but I'm failing to see or conceptualize it. for instance: Why does the following code output 3? [CODE] int a[2][4][2] = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; cout << a[1][2][1] << endl; //output is 3 [/CODE] How are the dimensions created? I am trying to draw it on paper, but it becomes convoluted and I get confused. Could someone offer clarify this array for me? Thanks for your guys' help.

Member Avatar
Member Avatar
+0 forum 6

Hello everyone, I have to code an array that in each row, it has 16 columns! So I called it myself a 17 dimensional array but I was wondering what data sturcture in Python can best represent this keeping in mind that, it should be easily addressable and modifible. For example, what I had in mind initially was a a list of lists, where the inner list has 16 entries: [CODE] 0 1 15 0 [ [] [] [] [] ...... [] ] 1 [ [] [] [] [] ...... [] ] 2 [ [] [] [] [] ...... [] …

Member Avatar
Member Avatar
+0 forum 2

Hello all. I am having difficulty getting my program to output data correctly. I have a class member function that is supposed to return the value of a specific member of a struct element based on identification with its (the struct element's) other members. [code] float MatrixType::valueAt(int i, int j) const { // code to return the float value at // significant location row i col j if(i == matrix[length].row && j == matrix[length].col) return matrix[length].value; // checks to match up row and col to find correct value else return 0.0; } // end accessor valueAt[/CODE] The matrix[] array is …

Member Avatar
Member Avatar
+0 forum 6

Hey all, I'm having a horrible time with a multidimensional array that I'm trying to create. I understand why it's creating it the way that it is, but don't know how I can fix it. If someone can assist, that would be amazing. Here's the current output: [code] Array ( [john] => Array ( [0] => smith [1] => thompson ) ) Array ( [david] => Array ( [0] => duval [1] => craig [2] => jacobs ) ) [/code] My desired output is: [code] Array ( [0] => Array ( [john] => Array ( [0] => smith [1] => …

Member Avatar
Member Avatar
+0 forum 3

hi, i need a little help. i have a 2d array adn i want to write out each rows minimum number. but something isnt good cause if the minimum is in the last position it says that the first number is the lowest. heres the code: [CODE] void minki(int k,int n, int m, int x[maxn][maxm]) { int a[n]; int l=0; for (int i=0; i<n; ++i) { int b=x[i][0]; for (int j=0; j<m; ++j) { if (b>x[i][j]) { l=x[i][j]; j++; } if (b<x[i][j]) { ++j; } else {l=x[i][0]; } a[i]=l; cout << "test " << a[i] << endl; } } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

So the assignment is to make a Rock Paper Scissors Spock Lizard Player that plays against another student's player without using any Random generation for 100000 trials. We are supposed to be able to detect the patterns/sequences in the other player by storing their past moves and looking for any repeating sequences. I'm doing a code in which I store the past moves in a two-dimensional array (but i don't really find a use for the second dimension?), and I keep checking if there is any repeating sequences within the past moves every time as the number of trials increase. …

Member Avatar
Member Avatar
+0 forum 1

I'm required to construct a three-dimensional array (a "universe"), but unlike traditional array navigation where you go to the end of the column, row, etc., increment and start at the beginning, I am required to move in reverse (like actually navigating a cube). The precise instructions: - Move along a row (through the columns) until it comes to a side edge - Move one layer deeper and then travel back along the row until it is back at a side edge - Repeat these movements until the back edge is reached. Then move down to the next row. - Move …

Member Avatar
+0 forum 0

I have written a code that will post random numbers into a 10x10 row/col setup. I'm trying to edit the last function of code so that the user see's something like this: Input a number 5 5 was found 3 times 5 is located at row 2, col 1; row 5, col 2 ; row 8, col 2 The current code does everything except output the last line... I've done some edits to the original code and below is what I got, can you help me figure out where Im going wrong please.. ?? [CODE]#include <iostream> #include <ctime> using namespace …

Member Avatar
Member Avatar
+0 forum 1

So i'm trying to make a module for my program that returns a multidimensional array based on another array in the form of a command-line argument. Here is the module that's keeping me up at night: [CODE]public static double[][][] getDimensions(String [] args) { final int l = args.length; double dimensions [][][] = new double[1][l][l]; for(int count = 0; count<l; count++) { if(args[count].equals("NA4")) dimensions[count][count][count] = {20.6, 15.7, 12}; if(args[count].equals("NA5")) dimensions[count][count][count] = {17.6, 15.7, 12}; if(args[count].equals("NA1")) dimensions[count][count][count] = {45, 18.5, 15}; if(args[count].equals("NA2")) dimensions[count][count][count] = {32.6, 17, 15}; else dimensions[count][count][count] = {14.5, 9.8, 7.1}; } return dimensions; }[/CODE] The error i get is …

Member Avatar
Member Avatar
+0 forum 4

Is it possible to rewrite the following VB.NET code in VB6? [CODE]Dim Names(,) As String = New String(,) {{"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}, {"UserName", "RealName"}} [/CODE]

Member Avatar
Member Avatar
+0 forum 4

The End.