Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. More About C Variables > External Variables

External Variables

Variables that are declared in a source file outside the scope of main or any subroutine are called external variables. In the following example, pageCount is an external variable:

int pageCount;

main()
{
...
  printf("The current page count is: %d\n", pageCount );
}

void addpage()
{
  pageCount++;
  ...
}

void deletePage
{
  pageCount--;
  ...
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint