Question: Sorry guys I know my english is bad, but i made examples so that my question is more clearer.  

**a.cpp**  

```
#include <iostream>

using namespace std;

void funcfoo(){
    cout << "test only" << endl;
}

int varfoo = 10;

```

**b.cpp**

```
#include <iostream>

using namespace std;

extern void funcfoo();

extern int varfoo;

int main(){

    funcfoo();

    cout << varfoo;

    return 0;
}

```

**Then I compile it like this "cl b.cpp a.cpp"**  

My question is. How come when I remove the "extern keyword before void funcfoo()" it works fine, but when i remove the extern keyword
before int var foo I get an error?

Answer: 
When you remove the `extern` from `extern void funcfoo();` you are forward declaring it so you're code below will know what `funcfoo()` is. If you were to do that to a variable, you would actually be instantiating it and would conflict with your other file. Hence the `extern` is saying "it exists, trust me ;)" that it gets resolved from your other file.
I know this might be late, but I hope this helps in some way. Check the link below and it ll give an idea of what extern is and how it works. 

```
http://www.geeksforgeeks.org/understanding-extern-keyword-in-c/

```

Thank you