Thread: multiple instance of ADT

  1. #1
    zsaniK Kinasz's Avatar
    Join Date
    Jan 2003
    Posts
    222

    multiple instance of ADT

    If i were to define an abstract data type with static variables. Is it possible to make more than one instance of that adt.?
    "Assumptions are the mother of all **** ups!"

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Is this a C or C++ question?
    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.

  3. #3
    zsaniK Kinasz's Avatar
    Join Date
    Jan 2003
    Posts
    222
    its a c question
    "Assumptions are the mother of all **** ups!"

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you mean like this, then the answer is no
    Code:
    struct wibble {
      int foo;
      static int bar;  // only one of these, no matter how much wibbling you do
    };
    C has no support for such an idea

    But there are ways around such problems
    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.

  5. #5
    zsaniK Kinasz's Avatar
    Join Date
    Jan 2003
    Posts
    222
    cool, i know it was a silly question but i just wanted to check
    "Assumptions are the mother of all **** ups!"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 06-08-2009, 03:03 PM
  2. Another question :O need ideas and confirmation
    By Akkernight in forum C++ Programming
    Replies: 7
    Last Post: 02-23-2009, 03:29 PM
  3. Which one is "quicker" ?
    By AloneInTheDark in forum C# Programming
    Replies: 2
    Last Post: 02-08-2008, 09:23 PM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  5. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM