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

  • Home
  • SEARCH
  • 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 8885061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:13:01+00:00 2026-06-14T21:13:01+00:00

I have 4 header files, all of them open data from a txt file

  • 0

I have 4 header files, all of them open data from a txt file with _wfopen(), like below:

FILE* file = _wfopen(L"data.txt",L"r,ccs=utf-8");

VC++ gives me an error C4996 but in one header file only, the other three have no error at all. How can I fix this ?
UPDATE:
My professor gave me this code.I compiled it and there’s only C4996 warning.Since I need to reuse it, I created a new project and copy everything in his code into the new project.Then it gave me a C4996 error.

  • 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-06-14T21:13:02+00:00Added an answer on June 14, 2026 at 9:13 pm

    A shallow search on the web indicates that you are using a deprecated function, raising, thus, the error C4996. As the example presents, you should be using the function _wfopen_s instead.

    ...
    // Create an the xml file in text and Unicode encoding mode.
    if ((fileHandle = _wfopen( L"_wfopen_test.xml",L"wt+,ccs=UNICODE")) == NULL) // C4996
    // Note: _wfopen is deprecated; consider using _wfopen_s instead
    {
        wprintf(L"_wfopen failed!\n");
        return(0);
    }
    ...
    

    The reason you have this error pointed only once for all of your four calls is that the compiler suppresses repeated errors.

    Ref: http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx

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

Sidebar

Related Questions

I have removed all header files within the below path due to numerous errors
I have around 120 header files (.h files) , and in all of them
I have a header file with all the enums listed (#ifndef #define #endif construct
I have a header file variable.h where i declare all my global variable.Then i
We have a web application with a common header file for all pages. We
I have a header file, lets say Common.h, that is included in all of
I have all the class definitions in a header file: ModelModule.h. I have provided
I have been seeing code like this usually in the start of header files:
I have all the boost header files in this repository and when I do
I have some external header files in a separate directory (its the sqlite3.h). I

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.