online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//Simple 2D array initialization and print example //Click run from the banner above public class Main{ //below is the method I will use to initialize a 2D array and print it to the console using a for...loop public String[][] printArr(){ //declaring a 2D array String[][] stringArr = new String[10][10]; //using nested for loop to initialize 2D array //outer loop loops through rows for(int row = 0; row < stringArr.length; row++){ //at each index of row in the outer loop //the inner loop loops completely through all column indexes for(int column = 0; column < stringArr[row].length; column++){ //using row and column index positions to initialize each array index with "* " //asterick and one space stringArr[row][column] = "* "; } } //using the same technique about to print the elements of the array for(int row = 0; row < stringArr.length; row++){ for(int column = 0; column < stringArr[row].length; column++){ //notice the use of the print(); statement ...doesn't not use ln on the end //this prints all row elements of each row on the same line System.out.print(stringArr[row][column]); } //notice this println(); statement is outside of the inner loop //allowing each row to be printed on a new line System.out.println(); } return stringArr; } public static void main(String[] args){ Main main = new Main(); main.printArr(); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue