0

the problem is.. a certain .dat file consists of 3 fields of data..for example...user account, password and username (gibsonML, sweetie33, Mel Gibson). How I will load it and then assign it to hash table. Thanks..

2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Salem
0

> How I will load it and then assign it to hash table
So is this about reading files, or hash tables?

0

the problem is.. a certain .dat file consists of 3 fields of data..for example...user account, password and username (gibsonML, sweetie33, Mel Gibson). How I will load it and then assign it to hash table. Thanks..

both...from a .dat file the content of it will be placed on the hash table..i am just confused how i will start the problem..

0

> How I will load it and then assign it to hash table
So is this about reading files, or hash tables?

both...from a .dat file the content of it will be placed on the hash table..i am just confused how i will start the problem..

0

fopen() to open a file, fclose() to close it when you're done.
fgets() to read each line from the file
sscanf() to extract information from the line

The first step is to show you can read the file reliably, Say by printing out
user account = gibsonML
password = ...
etc

for each valid record in the file.

Then we can talk about step 2

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.