0

I want to write a program to keep usernames and passwords on a dynamic 2 dimensional array. but I don't know how can I do this?

can you help me? and also my boss force me not to use structures.

Garf365
  • 3,619
  • 5
  • 29
  • 41
Me.Me
  • 19
  • 4
  • 1
    Please edit your question to add more information, like language you use, what had you already tried, .... – Garf365 Dec 06 '16 at 14:11
  • Duplicate: http://stackoverflow.com/questions/15062718/allocate-memory-2d-array-in-function-c – Garf365 Dec 06 '16 at 14:22
  • Welcome to stackoverflow.com. Please take some time to read the [help pages](http://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also please take the [tour](http://stackoverflow.com/tour) and read about [how to ask good questions](http://stackoverflow.com/help/how-to-ask). Lastly please learn how to create a [Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). – cschneid Dec 06 '16 at 15:06

1 Answers1

1

To keep usernames and passwords it is a bad idea to use a 2d array unless the number of users is small.

You need to keep them either in a trie or a hash table.

If you do not need to remove users then you can also use bloom filters for some operations (combined with some of previous methods).

alinsoar
  • 15,386
  • 4
  • 57
  • 74