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 61379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:18:36+00:00 2026-05-10T18:18:36+00:00

What translation occurs when writing to a file that was opened in text mode

  • 0

What translation occurs when writing to a file that was opened in text mode that does not occur in binary mode? Specifically in MS Visual C.

unsigned char buffer[256]; for (int i = 0; i < 256; i++) buffer[i]=i; int size  = 1; int count = 256; 

Binary mode:

FILE *fp_binary = fopen(filename, 'wb'); fwrite(buffer, size, count, fp_binary); 

Versus text mode:

FILE *fp_text = fopen(filename, 'wt'); fwrite(buffer, size, count, fp_text); 
  • 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. 2026-05-10T18:18:36+00:00Added an answer on May 10, 2026 at 6:18 pm

    I believe that most platforms will ignore the ‘t’ option or the ‘text-mode’ option when dealing with streams. On windows, however, this is not the case. If you take a look at the description of the fopen() function at: MSDN, you will see that specifying the ‘t’ option will have the following effect:

    • line feeds (‘\n’) will be translated to ‘\r\n’ sequences on output
    • carriage return/line feed sequences will be translated to line feeds on input.
    • If the file is opened in append mode, the end of the file will be examined for a ctrl-z character (character 26) and that character removed, if possible. It will also interpret the presence of that character as being the end of file. This is an unfortunate holdover from the days of CPM (something about the sins of the parents being visited upon their children up to the 3rd or 4th generation). Contrary to previously stated opinion, the ctrl-z character will not be appended.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to disable the activity slide transition that occurs during activity change for
Background information first: We are using a strongly-typed DataSet to manage transaction files. That
I am still fairly new to C++/cli and am not always sure when I
First of all, there is no chance that this is a multi-user issue, as
I have some 3D models that I render in OpenGL in a 3D space,
I have a ugly piece of code that adds event handlers. The problem is,
This question refers to the dequeueing of messages in Oracle Streams Advanced Queueing .
I am using Python 2.7 and trying to get a Django project running on
I'm trying to set up a simple atom feed from my Posts model and
I am currently working on the implementation of a slideshow control in an iPad

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.