question about declaring global variables

This is a discussion on question about declaring global variables within the C++ Programming forums, part of the General Programming Boards category; I remember reading somewhere on this forum(I think) that says declaring global variables outside/before the main function is bad. why ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Location
    oslo
    Posts
    26

    question about declaring global variables

    I remember reading somewhere on this forum(I think) that says declaring global variables outside/before the main function is bad.
    why is that?

    Dag
    life is too short smart but hard !

  2. #2
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    712
    For start, read this!
    Gotta love the "please fix this for me, but I'm not going to tell you which functions we're allowed to use" posts.
    It's like teaching people to walk by first breaking their legs - muppet teachers! - Salem

  3. #3
    Registered User
    Join Date
    Feb 2005
    Location
    oslo
    Posts
    26
    Ok thanks
    life is too short smart but hard !

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use global variables or pointers?
    By RealityFusion in forum C++ Programming
    Replies: 5
    Last Post: 09-22-2005, 09:47 PM
  2. Global Variables, include files and classes
    By sharpstones in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2005, 11:06 AM
  3. Replies: 1
    Last Post: 09-05-2004, 07:42 PM
  4. Global variables.. how bad?
    By punkrockguy318 in forum C++ Programming
    Replies: 19
    Last Post: 11-30-2003, 10:53 PM
  5. global variable and header question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-06-2002, 12:38 AM

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