CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

View: 2080|Reply: 0

Camne nak buat logfile dlm C++

[Copy link]
Post time 21-9-2006 05:05 PM | Show all posts |Read mode
ok.. aku ade problem sikit.. camne nak buat logfile n record setiap login yg masuk termasuk tarikh n time die login dlm logfile tu..

contohnya akunye system ade staff n admin login.. so camne bagi aku sbg admin nak tgk view logfile yg record setiap login samada admin ataupun staff..

penat aku godek buku c++ n website..hampeh tulll..care nak create .txt file aku tauuu aa.. camne nak buat functionn yg die akan record setiap login tak kisah  admin ataupun staff dan yg paling pening camne nak record time tuu.. time tu dpt dari system time bukan dari time yg di key in kan..


  1. #include <stdio.h>
  2. int main ()
  3. {
  4.   FILE * pFile;
  5.   pFile = fopen ("logfile.txt","w+t");
  6.   if (pFile!=NULL)
  7.   {
  8.     fputs ("Student ",pFile);
  9.     fclose (pFile);
  10.   }
  11.   return 0;
  12. }
Copy the Code


yg ni akan create logfile.txt

n lagi satu soalan.. camne nak create folder dlm c++.. kalo create .txt file aku tau laa.. tapi kalo nak create folder/directory camne plak??..

:geram::geram:
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

15-5-2024 05:00 PM GMT+8 , Processed in 0.137819 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list