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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:36:14+00:00 2026-05-27T04:36:14+00:00

I am reading/writing char s to a binary file. The program doing the reading/writing

  • 0

I am reading/writing chars to a binary file. The program doing the reading/writing may run on either a 32 or 64 bit machine. Furthermore, the file could be written in a 32-bit environment then read in 64 and vice-versa.

Therefore I need some way of storing chars that guarantees a certain width (the smaller the better). I’m sure there is an accepted/common way to do this, but being a C novice I don’t know it, and also can’t find anything via google..

Does any one know the trick?

  • 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-27T04:36:14+00:00Added an answer on May 27, 2026 at 4:36 am

    On any “normal” modern architecture chars are always of 8 bits, regardless of 64/32 bit issues. Those arise when you dump directly on a file the binary representation of int or other types (which can vary in size and byte ordering depending on architecture), but plain chars should be safe.

    … obviously if you are writing text you should choose some encoding, but that’s a completely different story…

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

Sidebar

Related Questions

I'm getting data from a binary file, reading from file and writing in a
While implementing XML file reading/writing in my application I saw that when I call
I'm writing a BF interpreter in C and I've run into a problem reading
I'm writing a program that gathers user input for two file names, and opens
I am working on a binary file transfer program in which the client has
Possible Duplicate: Reading/Writing MS Word files in Python I know there are some libraries
I have just been getting into low level programming (reading/writing to memory that sort
We have a .NET object that does a lot of reading/writing with the database.
I want to know the files a given process is reading/writing. Is there a
I copy and paste code from this URL for creating and reading/writing a proc

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.