extern var

This is a discussion on extern var within the C Programming forums, part of the General Programming Boards category; why don't we use all variables as external variables in c?...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    32

    Lightbulb extern var

    why don't we use all variables as external variables in c?

  2. #2
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    878
    Why would you want to? The extern keyword means the variable is defined in another file.

    Do you really mean to ask why don't we make all variables global?

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    > why don't we use all variables as external variables in c?
    Create a single global variable called 'i' and use if for ALL your loops.

    Then report back.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 08-16-2010, 10:00 AM
  2. [C#] Intercept SysListView32 item added
    By Devils Child in forum Windows Programming
    Replies: 9
    Last Post: 03-26-2010, 07:29 AM
  3. Need help assignment
    By 6kaine9 in forum C Programming
    Replies: 26
    Last Post: 10-19-2008, 08:51 PM
  4. Replies: 16
    Last Post: 10-29-2006, 04:04 AM
  5. server question
    By xddxogm3 in forum Tech Board
    Replies: 24
    Last Post: 01-21-2004, 12:12 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21