Thread: Extern and Global variables

  1. #1
    Registered User
    Join Date
    Feb 2015
    Posts
    15

    Extern and Global variables

    Hi,

    What is the difference between extern and global variables?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well extern is what you use to tell part of a program that a global variable exists somewhere else in another part of the program.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 04-10-2017, 01:58 AM
  2. extern Global array in seperate .h file
    By rocketman03 in forum C++ Programming
    Replies: 1
    Last Post: 09-30-2009, 06:03 AM
  3. static global & global variables
    By aqeel in forum C Programming
    Replies: 1
    Last Post: 09-25-2009, 12:32 PM
  4. using extern to have a global variable
    By steve1_rm in forum C Programming
    Replies: 3
    Last Post: 01-29-2009, 06:44 AM
  5. allocation for global variables in extern
    By Bobert in forum C Programming
    Replies: 13
    Last Post: 12-15-2007, 07:26 PM

Tags for this Thread