Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 508491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:54:46+00:00 2026-05-13T06:54:46+00:00

i am a beginner and want to file handling concept in win32 application for

  • 0

i am a beginner and want to file handling concept in win32 application for writing anything say text in file which is present in some location on hard disk.

Please Reply

Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:54:46+00:00Added an answer on May 13, 2026 at 6:54 am

    You can do in this way
    Suppose there is a folder called “XYZ” at “E:” drive & the file name is “abc.log” and the
    function which u call is say “WSL”.

    VOID __cdecl WSL(char *message);//function declaration
    

    //Function definition:

    VOID __cdecl WSL(char *message) 
    { 
       static int lineNo = 1;  
       FILE *fp = fopen("E:\\XYZ\\abc.log","a+");  
       if(fp!= NULL)  
       {   
            fprintf(fp,"%d : %s\n",lineNo++,message);   
            fclose(fp);
       } 
    }
    

    and at main function u r coding the following:

    int main()
    {
      FILE *fp = fopen("E:\\XYZ\\abc.log","w");
      WSL("Application opened");
      ........
      ........
      ........
      ........
      ........
      WSL("Application closed");
    }
    

    This will write two time at abc.log file since it is called twice in your main function.

    First time it will print…

    1. Application opened

    & second time it will print

    2. Application closed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner of Objective-C/iOS programing. I want make a one header file which
I am beginner at Sharepoint and i want to make a small application on
Im a Drupal beginner. I want to create a simple website, which has a
First of all i want to say that I'm still a beginner in ASP.NET
Using shell script I want to read a word from text file and return
I am a .net beginner. I need to add some data to xml file
i have some file on my server and want to download this file with
In start I want say, I am beginner in C# so be patient :)
I am a beginner with the Zend framework and want to do some logging
I'm a beginner! I have a txt file with some data arranged in column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.