Why is function mentioned in global declaration? I came accross this code for writing data into EEPROM in arduino. Why is void printTemp();, void clearEEPROM(); and void writeTemp(); functions are mentioned in global declaration? How will this help?
#include &lt;EEPROM.h&gt;
 
#define SAMPLE_TIME 2000  //The time between each EEPROM write function call in ms
     
int tempPin = 0;      //the ADC pin
int printPin = 2;     //the print button pin
int erasePin = 4;    //the erase button pin
 
int address = 0;      //EEPROM address counter
     
unsigned long timer;
     
float conv_coeff = 0.0;   //coefficient for converting from 0-1024 to 0-5 range
     
void printTemp();
void clearEEPROM();
void writeTemp();
     
void setup(){
  Serial.begin(115200);     //start the serial connection as always
  conv_coeff = 5.0/1024.0;  //find the coefficient to do the conversion
  timer = millis();         //millis() returns the time since program start in ms
}
     
void loop(){
  if(millis()-timer &gt; SAMPLE_TIME)  //check if it's time to do a temp sensor sample
  {
    writeTemp();
    timer = millis();
  }
     
  if(!digitalRead(printPin))  //check if print button is pressed
  {
    printTemp();
    delay(500);
  }
     
  if(!digitalRead(erasePin)) //check if erase button is pressed
  {
    clearEEPROM();
    delay(500);
  }
       
  delay(1);
}
     
void printTemp()
{
  for (int i = 0 ; i &lt; EEPROM.length() ; i++) {
    byte value = EEPROM.read(i);                //read EEPROM data at address i
    if(value != 0)                              //skip &quot;empty&quot; addresses
    {
      float temp = value*conv_coeff;            //convert ADC values to temperature
      temp = (temp - 0.5)*100;                  //take care of the offset
     
      Serial.println(temp);
    }
  }
}
     
void clearEEPROM()
{
  for (int i = 0 ; i &lt; EEPROM.length() ; i++) {
    if(EEPROM.read(i) != 0)                     //skip already &quot;empty&quot; addresses
    {
      EEPROM.write(i, 0);                       //write 0 to address i
    }
  }
  Serial.println(&quot;EEPROM erased&quot;);
  address = 0;                                  //reset address counter
}
     
void writeTemp()
{
  byte value = analogRead(tempPin);     //read sensor value
       
  EEPROM.write(address, value);         //write value to current address counter address
     
  Serial.print(&quot;Sensor value stored at address &quot;);
  Serial.println(address);
    
  address++;                      //increment address counter
  if(address == EEPROM.length())  //check if address counter has reached the end of EEPROM
  {
    address = 0;              //if yes: reset address counter
  }
}
Those are called function prototypes.  They mean "These functions exist somewhere else".  That "somewhere else" could be later on in the same file, or a different file entirely.

Usually these kind of things are provided by header (.h) files, or are automatically created (for functions in the INO file) by the IDE and hidden from you, so you never really see them. But if you're not using the IDE then you need to have them so your code (which is parsed linearly) knows that these functions exist before the parser comes across them.