title: can i access the variable declared in main in any function?
body: <p>i have two files </p>
  
  <pre><code> books.cpp and books.h
  </code></pre>
  
  <p>i am using these classes in my main function.
  i also have a function <em>func</em> in main.cpp file.</p>
  
  <pre><code>#include iostream
  #include "books.h"
  void func(int a, int b);
  int main(){
      books book;
      func(5,6);
      return 0;
  }
  
  void func(int a, int b){
     //can i use the book object declared in main in this function?
  }
  </code></pre>
  
  <p>i want the books class object book declared in main in the function how can i access it?
  can anyone help me please?</p>