multiple instance of ADT

This is a discussion on multiple instance of ADT within the C Programming forums, part of the General Programming Boards category; If i were to define an abstract data type with static variables. Is it possible to make more than one ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 02:29 PM
  3. Which one is "quicker" ?
    By AloneInTheDark in forum C# Programming
    Replies: 2
    Last Post: 02-08-2008, 08:23 PM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  5. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM

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