answersLogoWhite

0

An example might help

int myarray [] = {2,0,1,3,1,1,2,9};

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

In Java can Array be extended after it has been initialized?

In Java, arrays have a fixed size once they are initialized and cannot be extended. If you need a resizable array, you can use the ArrayList class from the Java Collections Framework, which allows for dynamic resizing. Alternatively, you can create a new array with a larger size and copy the elements from the original array to the new one if you want to extend an existing array.


How do you initialise a two dimentional array?

C provides rectangular multidimensional arrays. In C, a two-dimensional array is really a one-dimensional array, each of whose elements is an array. An array is initialized by a list of initializations in braces; each row of a two-dimensional array is initialized by a corresponding sub-list. Example of two dimensional array initialization: char array_example[2][4] = { {11, 12, 13, 14}, {21, 22, 23, 24} };


Variables declared using the string data type usually are initialized to the empty string?

Yes.


How do you get the middle number for the turbo c using array?

it depends how you have coded your program as: if you initialized your array (a) by loop from 0 then int lb=0,ub=n-1; //n is number of elements in array int mid=(lb+ub)/2; printf("middle number is :%d",a[mid]); if you initialized your array (a) by loop from 1 then int lb=1,ub=n; //n is number of elements in array int mid=(lb+ub)/2; printf("middle number is :%d",a[mid]);


Which one of the following statements allocates enough space to hold an array of 10 integers that are initialized to 0?

int *ptr = (int *) calloc(10,sizeof(int));

Related Questions

Can array be initialized if they are static?

Yes.


In Java can Array be extended after it has been initialized?

In Java, arrays have a fixed size once they are initialized and cannot be extended. If you need a resizable array, you can use the ArrayList class from the Java Collections Framework, which allows for dynamic resizing. Alternatively, you can create a new array with a larger size and copy the elements from the original array to the new one if you want to extend an existing array.


How do you initialise a two dimentional array?

C provides rectangular multidimensional arrays. In C, a two-dimensional array is really a one-dimensional array, each of whose elements is an array. An array is initialized by a list of initializations in braces; each row of a two-dimensional array is initialized by a corresponding sub-list. Example of two dimensional array initialization: char array_example[2][4] = { {11, 12, 13, 14}, {21, 22, 23, 24} };


Variables declared using the string data type usually are initialized to the empty string?

Yes.


How jagged array can be initialized using indexer?

A jagged array, which is an array of arrays, can be initialized using indexers in C# by first declaring the array and then specifying the size of each sub-array. For example, you can create a jagged array like this: int[][] jaggedArray = new int[3][];, and then initialize each sub-array individually, such as jaggedArray[0] = new int[2]; and jaggedArray[1] = new int[3];. You can also initialize it inline, like int[][] jaggedArray = new int[][] { new int[2], new int[3], new int[1] };. This allows for flexible sizing of each inner array.


How do you get the middle number for the turbo c using array?

it depends how you have coded your program as: if you initialized your array (a) by loop from 0 then int lb=0,ub=n-1; //n is number of elements in array int mid=(lb+ub)/2; printf("middle number is :%d",a[mid]); if you initialized your array (a) by loop from 1 then int lb=1,ub=n; //n is number of elements in array int mid=(lb+ub)/2; printf("middle number is :%d",a[mid]);


How do you make source codes of of declaring an array of type double values?

It declares an array of type double, it has size of 10, and all elements are initialized to 0;...int myArraySize = 10;double myArray[myArraySize] = {0.0}...


What variable is one that has been declared but has not been initialized or assigned a value?

Uninitialized Page 59 Programming Logic and Design by Tony Gladdis


What variable is one that has been declared but has not been initialized or assigned value?

Uninitialized Page 59 Programming Logic and Design by Tony Gladdis


How is a10-element char array declared?

char myCharArray[10];


Which one of the following statements allocates enough space to hold an array of 10 integers that are initialized to 0?

int *ptr = (int *) calloc(10,sizeof(int));


How do you declare a string array and add elements to it in C plus plus?

You cannot add elements to a fixed array in C or C++. If, however, the array is declared as a pointer to an array, you can add elements by allocating a new array, copying/adding elements as needed, reassigning the new array to the pointer, and deallocating the original array.

Trending Questions
What is Loss of resistance technique? What special tasks can robots do? What should you do if your daughters mouse keeps rolling over and over and you think it is dying? If the excitation of generator changes what happens to the terminal voltage? What is the average salary for a service engineer job? How can a 110 volt table saw be rated 4 horsepower at 15 amps? What is the definition of old 3 wythe load bearing brick walls? What skills are needed to be a computer engineer? What are examples of end products of technical writing? Will there be a current flow if the resistor burn out which is connected in series? Your Aieee state rank is 1220 and all India rank is 27000 and you are from haryana and can you get into any NIT? Can you still be good at physics and engineering if you are not good at computer programming in terms of writing code in every programming language and biology? Why do you get the error in VB6 Compile error Expected then an equals sign on this code MsgBoxmsg buttons title PS I already defined the variables msg buttons and title and they are in brackets? What type of motor is used in ac servometer? What are the Example each for self induced and mutually induced emf? Difine the formation of p and n type semiconductors? Europe 3 phase motor wiring how to go to low voltage 230 volt AC Currently wired w2 u2 and v3 tied together with w1 u1 and vi to line for 460 voltage Y How do you wire for low voltage? A lever of a machine worked by using the foot that start with trea? What are OSHAs electrical standards are based on? Why do robots need to look like humans?