Thread: extern usage

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2023
    Posts
    45

    Talking extern usage

    Without the static line in file1.cpp being commented out I get 300 201 300. So the extern in the function is not being used but the static variable is instead. If I do comment out the static line I get 300 301 301 which is what I expected. Why does the static declaration override the extern?
    maxcy / wt1v
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 04-13-2020, 09:48 PM
  2. Replies: 9
    Last Post: 05-07-2017, 12:29 PM
  3. how extern is extern?
    By davo666 in forum C Programming
    Replies: 11
    Last Post: 03-05-2009, 04:45 AM
  4. usage of extern keyword
    By ilikepure in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2007, 06:24 PM
  5. Replies: 17
    Last Post: 12-15-2006, 11:02 AM

Tags for this Thread