Thread: vector static abstract data structure in C?

  1. #1
    Unregistered
    Guest

    vector static abstract data structure in C?

    i posted this last week but my post was a bit vague so i apologise

    what i'm looking for is any help regarding the above subject, the code has to be in strict 'C' no 'C++'

    for those who dont know what a vector data structure is(me included ), is a structure that holds a set amount of data items, were talking data here and not that maths stuff, for example


    struct datatype
    {
    char errorMessage[27];//will hold each individual message
    };

    struct vector
    {
    datatype data[10];//will store 10 error messages
    };


    i'm not sure if thats the correct way to set up a vector structure, if anyone has any ideas or tips for me i'd be well gratefull

    p.s. i dont need the entire proggie, just hints for the structure

    thanx

    korbitz

  2. #2
    Registered User *pointer's Avatar
    Join Date
    Oct 2001
    Posts
    74
    I'm not exactly sure what you're asking. You want a structure that contains an array of strings?
    Code:
    typedef struct vector{
        char *errorMessages[10][50];
    } VECTOR;
    That will create a structure called VECTOR that contains an array of 10 pointers to arrays of 50 characters.

    Appologies if this isn't what you want.
    pointer = NULL

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    54
    to be perfectly honest i aint 100% sure, i know for a fact that when you delete one of the messages the space remains and can be filled with another message or some other data

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Include GTK+ just for a data structure?
    By Jesdisciple in forum C Programming
    Replies: 0
    Last Post: 04-12-2009, 07:19 PM
  2. pthread question how would I init this data structure?
    By mr_coffee in forum C Programming
    Replies: 2
    Last Post: 02-23-2009, 12:42 PM
  3. static data structure in a library
    By melight in forum C Programming
    Replies: 6
    Last Post: 01-10-2009, 11:12 AM
  4. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  5. Dynamic Data Structure -- Which one is better?
    By Yin in forum C++ Programming
    Replies: 0
    Last Post: 04-10-2002, 11:38 PM