Chciałbym prosić o pomoc przy przetłumaczeniu jednej funkcji z javy na c++
Poniżej podaje kod źródłowy napisanego w Javie
public static String toString(double[][] A) {
// Convert the matrix A into a String suitable for printing.
String answer = new String();
for (int i = 0; i < A.length; i++)
{
for (int j = 0; j < A[i].length; j++)
answer += A[i][j]+ "\t";
answer += "\n";
}
return answer;
}
Przez długi czas zastanawiałem jak przetłumaczyć z Javy tą zmienną double[][] A
Serdecznie Pozdrawiam
– Dodane 04.05.2012 (Pt) 9:36 –
Witam
Podczas tłumaczenia różnych funkcji napotkałem się jeszcze na taki problem:
Jak przetłumaczyć tą funkcję:
public static double[] times(double[] x,double c) {
// Returns the term-wise product c x.
double[] answer = new double[x.length];
for (int i = 0; i < x.length; i++)
answer[i] = c * x[i];
return answer;
}