Can Pascal and/or C tables be stored completely in memory, e.g. RAM?

If so, can the tables be indexed if held in memory?

Thank You
Who is Participating?
Emmanuel PASQUIERConnect With a Mentor Freelance Project ManagerCommented:
What do you mean by table ?
an array ? or a database of some kind ?

Whatever the language, and probably also whatever the OS (don't know Solaris at all, but that is common sense), if you declare variables in your application they are kept in memory. Now, when your application have too much data in memory, some pages are swaped to harddrive, and then it's another story. Your application has no control over that - except by making sure that you only keep in memory the data you really need in short term, thus reducing the swaping.

About index : if you have a very large array (of records) - ie a table - loaded in memory, searching in this unsorted table might take some time. So yes, that is when some kind of index will be built to make a quick lookup of some records. Your application have to implement its own index for each table/field that need quick lookup. Usually, you will build a hashlist. If you don't know what a hashlist is all about, just ask.
But if your application will need something more than a few lookup fields (by exact value) and/or complex queries (multiple filters), then you should forget the idea of doing it 'the old way' and use a real DBMS with SQL support.
Brian UtterbackPrinciple Software EngineerCommented:
This is certainly possible with C. It is not clear about Pascal, since there is no bundled Pascal compiler in Solaris, so I don't know which one you are using and its characteristics.

However, I suspect that there is morr behind this question, since for C, variables are kept in memory by default. Perhaps there is more to your question? Why do you ask?
gdamiani123Author Commented:
Thank you...could you please explain the hashlist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.