Click to See Complete Forum and Search --> : UserDatabase in a DLL


Antri
June 17th, 2002, 04:55 AM
I want to write a UserDatabase in a DLL which allows to store Usernames and Passwords in a Bin or Ascii-File. How can I write Data to a ascii File. Has anyone a tutorial on File I/o?

Please help me !?!

JMS
June 17th, 2002, 01:33 PM
look up fprintf and or fopen. To retreive them programatically you could use fscanf.

#include <stdio.h>
#include <process.h>

FILE *stream;

void PutLogin( char *pszUserid, char pszPassword )
{
char c = '\n';

stream = fopen( "fprintf.out", "a+);
fprintf( stream, "%s\t%s\n", szUserid, pszPassword );
fclose( stream );
}