Thread: global and static variable in a class delivered in a DLL

  1. #16
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    Codeplug: Maybe you are also interested in this thread:

    http://cboard.cprogramming.com/showthread.php?t=98673

  2. #17
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    c:\static_vs_dll_test\debug>app_part.exe
    Address of static member from main app: 004111A9
    Address of static member from DLL: 10018004
    There was something wrong with your test case here. The main module didn't link to the exported "myStatic" - instead it got it's own copy. I can't comment as to why this particular test case showed two instances - all I know is when I run my own test cases it works as expected.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Static Local Variable vs. Global Variable
    By arpsmack in forum C Programming
    Replies: 7
    Last Post: 08-21-2008, 03:35 AM
  2. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 05:05 PM
  3. static class variable vs. global variable
    By nadamson6 in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2005, 03:31 PM
  4. Replies: 2
    Last Post: 10-02-2004, 10:12 AM
  5. Static global variable acting as global variable?
    By Visu in forum C Programming
    Replies: 2
    Last Post: 07-20-2004, 08:46 AM