Thread: static data structure in a library

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    here you go:
    Code:
    static struct point {
      int x;
      int y;
    } a;
    If you already know structures (you do, right?) it does not change anything for you: it simply tells the compiler to keep this object 'a' private (i.e. not exported when linking with other binaries).

    PS: for the part related to the creation of a library (static? dynamic?) it depends on your tools and platform.
    Last edited by root4; 01-10-2009 at 05:27 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do i do this? (static structure inside class)
    By 39ster in forum C++ Programming
    Replies: 4
    Last Post: 11-17-2008, 03:14 AM
  2. Replies: 19
    Last Post: 01-12-2006, 11:04 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  5. Dynamic Data Structure -- Which one is better?
    By Yin in forum C++ Programming
    Replies: 0
    Last Post: 04-10-2002, 11:38 PM