Monday 22 June 2020

Why indexing in array starts with 0 ?


Array Index starts with zero

In most common programming languages, the indexing in array starts with zero (0). The reasons behind this are:

In programming languages like C and C++, the array name refers to the location in the memory which means the array name simply points to first element of the array and array[n] refers to the location of n-elements away from the first element. Here, n is used as an offset from the array’s first element. So the first element is at zero (0) distance away from the array. That’s why array index starts with zero.


Performance overhead:

Zero (0)-based index allows array[n] to be implemented as *(array + n). If index were one (1)-based, compiler would need to generate *(array + n - 1), and this "-1" has some performance overhead. As this extra subtraction instruction lowers the performance to low extent but this adds up to a lot when one has to write for the Compiler.  

And the common programming languages developed after C and C++ follows the same design logic for the indexing of the array.

Here is the proof:

#include <stdio.h>

int main()
{
    int array[5] = {1, 2, 3, 4, 5};
   
    printf( "Array location: %p\n", array );

   printf( "Array location of first element: %p\n", array[0] );


}

 

Output:

Array location: 0x7ffde4bf25b0
Array location of first element: 0x7ffde4bf25b0

 

See the output above, both array and array[0] refers to the same memory location.

Disable or Enable Outlook Sync for G Suite Users

Or, How to disable or enable MS Outlook email synchronization for G Suite users?

Or, How to disable or enable GSSMO synchronization for G Suite users

Or, OU or Tenant level control of GSSMO Synchronization (enable or disable)

 

Descriptions: You may be in a situation where you may need to disable or enable the email synchronization to outlook application for all or some group of your G Suite users.

Few folks may need to have outlook sync enabled for their users to give them feasibility to access emails from outlook app as it is more friendly to use, whereas, few folks may need to disable the email sync for their G Suite users to enforce the usage of online Gmail platform for various reasons.

A step by step process is being explained in this article to help you to achieve this requirement.

 

Steps: Enable or Disable the outlook sync for G Suite users

Sign in to the Google Admin console

Click on Menu option



Click on Apps > Click on G Suite



Now, Click on Gmail



Click on End User Access


Click G Suite Sync (here you may choose to go with either the root OU or the Sub-OUs you have created specifically for Disabling or Enabling this feature).


Check Mark the Enable G Suite Sync for Microsoft Outlook for my users box to enable outlook email sync or Remove the check mark from Enable G Suite Sync for Microsoft Outlook for my users to disable the outlook email sync.



Click Save.


Cheers, please write me back if you have any query of feedback on this.