Memory class in c language

I do not know about memory class of c language ever.
recently I have restarted learning c language and to check language format detail.
Example, static class.
static class is keep data in variable when after called func.
usually, data is not keep that func is called over like this

function m(){
  var num = 0;
  num++;
  alert(num);
}

for(var i=0;i<10;i++){
   m(); //1
}

If you want to increase num, you have to move num to global area or make closure.

function clo(){
  var num = 0;
  return function(){
    alert(num);
    return num++;
  }
}

var clolo = clo();
for(var i=0;i<10;i++){
   clolo(); //1→2→3
}

But in case you write in c language, you use static class!

#include <stdio.h>

void f();

int main(void){
  int i;
  for(i=0;i<10;i++){
     f();
  }
}

void f(void){
  static int num = 0;
  num++;
  printf("%d",num);
}