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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:34:51+00:00 2026-05-13T17:34:51+00:00

Is there any difference in C that is written in Windows and Unix? I

  • 0

Is there any difference in C that is written in Windows and Unix?
I teach C as well as C++ but some of my students have come back saying some of the sample programs do not run for them in Unix. Unix is alien to me. Unfortunately no experience with it whatsoever. All I know is to spell it. If there are any differences then I should be advising our department to invest on systems for Unix as currently there are no Unix systems in our lab. I do not want my students to feel that they have been denied or kept away from something.

  • 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-13T17:34:52+00:00Added an answer on May 13, 2026 at 5:34 pm

    That kind of problems usually appear when you don’t stick to the bare C standard, and make assumptions about the environment that may not be true. These may include reliance on:

    • nonstandard, platform specific includes (<conio.h>, <windows.h>, <unistd.h>, …);
    • undefined behavior (fflush(stdin), as someone else reported, is not required to do anything by the standard – it’s actually undefined behavior to invoke fflush on anything but output streams; in general, older compilers were more lenient about violation of some subtle rules such as strict aliasing, so be careful with “clever” pointer tricks);
    • data type size (the short=16 bit, int=long=32 bit assumption doesn’t hold everywhere – 64 bit Linux, for example, has 64 bit long);
    • in particular, pointer size (void * isn’t always 32 bit, and can’t be always casted safely to an unsigned long); in general you should be careful with conversions and comparisons that involve pointers, and you should always use the provided types for that kind of tasks instead of “normal” ints (see in particular size_t, ptrdiff_t, uintptr_t)
    • data type “inner format” (the standard does not say that floats and doubles are in IEEE 754, although I’ve never seen platforms doing it differently);
    • nonstandard functions (__beginthread, MS safe strings functions; on the other side, POSIX/GNU extensions)
    • compiler extensions (__inline, __declspec, #pragmas, …) and in general anything that begins with double underscore (or even with a single underscore, in old, nonstandard implementations);
    • console escape codes (this usually is a problem when you try to run Unix code on Windows);
    • carriage return format: in normal strings it’s \n everywhere, but when written on file it’s \n on *NIX, \r\n on Windows, \r on pre-OSX Macs; the conversion is handled automagically by the file streams, so be careful to open files in binary when you actually want to write binary data, and leave them in text mode when you want to write text.

    Anyhow an example of program that do not compile on *NIX would be helpful, we could give you preciser suggestions.

    The details on the program am yet to get. The students were from our previous batch. Have asked for it. turbo C is what is being used currently.

    As said in the comment, please drop Turbo C and (if you use it) Turbo C++, nowadays they are both pieces of history and have many incompatibilities with the current C and C++ standards (and if I remember well they both generate 16-bit executables, that won’t even run on 64 bit OSes on x86_64).

    There are a lot of free, working and standard-compliant alternatives (VC++ Express, MinGW, Pelles C, CygWin on Windows, and gcc/g++ is the de-facto standard on Linux, rivaled by clang), you just have to pick one.

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

Sidebar

Related Questions

I have a Windows Mobile application written in Java that uses AWT for the
I have seen that some programs which were written by me and assembled for
For some reason I have to have a windows client application (written in C#)
I have a windows service written in C# that creates a truck load of
Are there any ways to determine what the differences in databases are that affect
Is there any way with phpdoc to document the different values that a class
Is there any place that showcases a bunch of different types of rating systems
Is there any c# library that handles lossless conversion between different image formats?
Is there any way to make two controls that are in different containers the
Is there any difference in using login_required decorator in urls.py and in views.py ?

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.