answersLogoWhite

0

I'm not sure what you're asking. Do you mean when you declare/instantiate an array like this?

int[][] arr;

arr = {{1, 2, 3},{4, 5, 6}};

I think that's right.

***********************************

THIS IS INCORRECT

because you can assign constant values to array only at time of initialization.

Therefore above code will throw an error.

Correct way is:

int[][] arr = {{1, 2, 3},{4, 5, 6}};

thanx ..

itsabhinav123@gmail.com

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Declare a numerical variable precise and initialize it to the value 1.09388641?

double precise = 1.09388641;


Write a pseudocode statement that declares the variable total so it can hold integers Initialize the variable with the value 0?

Declare Real price=49.95 Display "the original price." Input item original price Display "price"


How do you initialize an array at compile time in c?

In C, you can initialize an array at compile time by specifying its elements within curly braces during declaration. For example, you can declare and initialize an integer array like this: int arr[] = {1, 2, 3, 4, 5};. The size of the array can be omitted, and the compiler will automatically deduce its size based on the number of elements provided. Additionally, you can specify the size explicitly, such as int arr[5] = {1, 2, 3, 4, 5};.


How do you declare and initialize constant arrays?

example in C: const int a [] = {10, 20, 40, 80};


How do you find factorial 5 in C programming?

to find the factorial we declare a variable n and initialize its value to 1 initiate a loop for example a for loop and multiply the numbers upto 5 code:- for(i=1,n=1;i<=5;i++) { n=n*i; }


Can you declare a variable with abstract keyword?

no it is not possible


How do you declare an integer?

datatype variable name;


What is variable declarations?

A variable declaration is a math or programming term. A variable is an unnamed component. In the problem the wording will declare what the value of the variable is.


How you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;


How can I declare a double precision variable in Fortran?

To declare a double precision variable in Fortran, you can use the "real(kind8)" declaration. This specifies that the variable should be of double precision, which is typically 8 bytes in size.


Can you declare SQLCODE in working storage section?

No, you cannot declare SQLCODE in the Working-Storage Section of a COBOL program. SQLCODE is a special variable used to indicate the success or failure of SQL statements and is automatically provided by the database interface when executing SQL commands. Instead, it is typically referenced directly after executing SQL statements without needing an explicit declaration in the Working-Storage Section.


When do you declare a variable?

You declare a variable when you create it by specifying its datatype and name in a programming language. This tells the compiler or interpreter to allocate memory for the variable. Variables must be declared before they can be used in most programming languages.