arrays - In C language, What is the difference between extern buffer[] and extern *buffer? -


i read below piece of information in microsoft article;

https://support.microsoft.com/en-us/kb/44463

the text below presents example of common programming mistake, is, confusing array , pointer declaration: consider application divided several modules. in 1 module, declare array follows:

  signed char buffer[100]; 

in module, declare following variables access array:

 extern signed char *buffer;           // fails    extern signed char buffer[];          // works 

if view code in codeview debugger, indicates *buffer declaration produces different address buffer[] declaration does.

  1. but can't understand why cannot access array using *buffer , can access using buffer[] .

  2. someone please explain me difference between 2 types?

see these questions in c faq list:


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -