answersLogoWhite

0

No arr refers to address of array &arr refers address of address of array but compiler treats arr and & arr, so even you place arr and & arr no error only warnings will be displayed.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Are the expressions ARR and and ARR same for char20?

Yes, 'ARR' and 'ARR' are the same for char20. Whatever it means.


How will you initialize a 2-d array?

All arrays are one-dimensional. A two-dimensional array is simply a one-dimensional array of one-dimensional arrays: int a[2][3]; This is an array of 2 elements where each element is itself an array of 3 integers. In other words it is an array of 6 integers. The two dimensions simply allow us to split the array into two sub-arrays of 3 elements each.


How do you sort array in php without use of sort function?

$arr=array(2,5,4,6,7,8,1); for($i=0;$i<count($arr);$i++) { for($j=$i;$j<count($arr);$j++) { if($arr[$i] > $arr[$j]) { $temp=$arr[$i]; $arr[$i]=$arr[$j]; $arr[$j]=$temp; } } }


What is the base address of an array in c program?

the address of variable (pointer) that contains array


Why and is not required for an array in scanf in c?

The name of the array means the address of the first element, so 'arr==&arr[0]'


How do you convert from array notation to pointer notation?

In the C and C++ languages the array notation arr[i] is completely equivalent to the pointer notation *(arr + i).


Write a program in C to accept 10 integers and print them in reverse order using linked list?

# include<stdio.h> # include<conio.h> void main() { int arr[10]; int i,j,temp; clrscr(); for(i=0;i<10;i++) scanf("%d",&arr[i]); for(i=0;i<9;i++) { for(j=i+1;j<10;j++) { if(arr[i]<arr[j]) { temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } } } printf("\nSorted array elements :\n"); for(i=0;i<10;i++) printf("%d ",arr[i]) ; getch(); }


What do you mean by array overflow?

for example:int arr[3];arr[0] = 1; /* ok */arr[1] = 2; /* ok */arr[2] = 0; /* ok */arr[3] = -1; /* wrong */arr[-1] = -3; /* wrong */


How do you reference the elements in an array?

To reference elements in an array, you typically use the array name followed by an index in square brackets. The index usually starts at 0 for the first element, so for an array named arr, the first element would be accessed with arr[0]. For example, arr[1] would reference the second element. Ensure that the index is within the bounds of the array to avoid errors.


How do you use dynamic memory allocation in getting a array?

Its simple void main() { int *arr[10]; arr=(int*)malloc(sizeof(int)*10); ...... ...... ...... ...... free(arr); }


How to write a program to store ten elements to an array and display the smallest element using C programming?

You data has to be stored in the array arr[] of size 10.double min(const arr[], int arrSize){double minimum = arr[0];for (int j = 0; j < arrSize; j++){if (minimum > arr[j]){minimum = arr[j];}}return minimum;}


What is the c program to sort the n elements in the array in ascending order?

The following example repeatedly asks for a number. As each number is entered, the array (arr) is dynamically resized to accommodate the new number. To finish entering numbers, enter any non-number (such as the letter X). If any numbers were entered, the array is then sorted using a simple bubble sort and the result is then displayed. Note that resizing an array like this is highly inefficient because the array must be copied each time it is resized. If you can determine how many numbers will be entered in advance (at runtime), then the array can be allocated just once, before reading the numbers into each array element. #include &lt;iostream&gt; int main() { float t, num = 0, *arr = NULL; int max = 0, i, j; while( 1 ) { printf( "\nEnter a number:\n(Any letter to quit)\n&gt;" ); int iResult = scanf( "%f", &amp;num ); if( !iResult ) break; arr = ( float * ) realloc( arr, ++max * sizeof( float )); arr[ max-1 ] = num; } printf( "%d numbers entered.\n", max ); if( max ) { for( i=1; i&lt;max; i++ ) { for( j=0; j&lt;max-i; j++ ) { if( arr[j] &gt; arr[j+1] ) { t = arr[j]; arr[j] = arr[j+1]; arr[j+1] = t; } } } printf( "Sorted:\n"); for( i=0; i&lt;max; i++ ) printf( "%f\n", arr[i] ); printf( "\n" ); free( arr ); arr = NULL; } return( 0 ); }