answersLogoWhite

0

If this is a homework related question, you really should consider trying to solve it yourself before looking at this answer. Otherwise, the value of the lesson, and the reinforcement provided by the assignment, will be lost to you.

You do not create individual elements of arrays in C or C++. You create the array, and then reference the elements. Say you want to create a 10 x 20 array of floats. You would declare float MyFloatArray[10][20]. You would then reference the elements, such as MyFloatArray[3][8]. Note that 10 and 20 are the number of elements in each direction, but the valid range of indices is 0 to 9 and 0 to 19, respectively.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Write c program to find median?

If you are using an array : sort using qsort() then take middle element.


How can you find factorial of each element in array using pointer?

To find the factorial of each element in an array using pointers in C, you can create a function that takes a pointer to the array and its size as parameters. In the function, iterate through the array using pointer arithmetic, calculating the factorial for each element and storing the result back in the same array or a separate array. For calculating the factorial, you can use a simple loop or recursion. Finally, print or return the modified array with the factorials.


How do you find particular element in array?

by using index position we can find the particular element in array.


Write a program in c to find the largest no out of a matrix of order mn?

/* using ellipses (...) to indicate tabs for clarity */ double largest (double *array, int M, int N) { ... int i, j; ... double *element; ... double answer = array[0][0]; ... for (i=0; i<M; i++) { ... ... for (j=0; j<N; j++) { ... ... ... element = array + i*M + j; ... ... ... if (*element > answer) answer = *element; ... ... } ... } ... return answer; }


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


How do you represent binary tree using array?

The root of the tree is stored in array element [0]; for any node of the tree that is stored in array element [i], its left child is stored in array element [2*i], its right child at [2*i+2]


Why and is not using ' and ' in reading a string using scanf?

I guess you wanted to ask, why is it scanf ("%s", array)and not scanf ("%s", &array).Well, array is by definition a pointer to the first element: array = &array[0]


How do you display 15 numbers in an ascending order using an array?

Sort the array then traverse the array, printing the element values as you go.


Write an Algorithm to delete a last element from the array?

// Assuming you dynamically allocated this array using "new"... delete array[arraysize - 1]; arraysize--;


How do you print element in array using javascript?

You would insert this command right after your array values have been specified.document.write(name of array[Number on array this item is, starts at 0])


Sample program array using buffered reader?

system.exit o


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.