Solved

Platform independent or not

Posted on 2002-03-14
7
352 Views
Last Modified: 2012-05-04
Is C++ a platform indepented languange or not ?
 if yes why ?
 one of my friend argude about it as plateform independent languge , any one know about it in detail
0
Comment
Question by:yasinmon
7 Comments
 
LVL 12

Accepted Solution

by:
pjknibbs earned 25 total points
ID: 6864396
The language itself is platform independent, in that there is a standard way it's supposed to work across all platforms. However, there's no platform-independent way in C++ of, say, opening a window on a GUI or reacting to mouse clicks--these are all implemented via specific APIs on specific platforms, so a C++ program written for a Mac will not compile and run on a Windows PC. (However, a C++ program written for a UNIX command-line might well compile as a Windows console-mode application--it just wouldn't be able to do anything operating system specific).

Note that even a cross-platform language like Java would suffer this problem if it weren't for the fact the language definition specifies a generic way of doing things normally done by the operating system--in other words, Java has its own functions with their own syntax for doing things you would need to use the operating system calls for in C++.
0
 
LVL 6

Expert Comment

by:jwenting
ID: 6864879
to summarise, yes and no.
The core language is platform independent but the libraries used for each OS are not and neither are the compiled binaries (even when using no platform specific code).

Many companies and groups wanting a platform independent program end up writing a core that is indeed platform independent (needing only recompilation on the new platform) plus a set of libraries that provide the platform-dependent calls via an interface that is identical for each platform.
They can then ship the core + the library for the platform the customer orders for each hardware/OS supported.
0
 
LVL 11

Expert Comment

by:griessh
ID: 6865135
C++ is completely platform independent. You can write C++ programs even on paper :-)

The platform comes into the game when you use libraries that have access to your specific system. That is usually graphics, filesystem and peripherals.

======
Werner
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6870355
Please maintain your open questions:

Questions Asked 7
Last 10 Grades Given B  
Question Grading Record 1 Answers Graded / 1 Answers Received

Thanks,
Anthony
0
 

Author Comment

by:yasinmon
ID: 6877471
hai  griessh  
   your funny guy , I agreed
0
 
LVL 11

Expert Comment

by:griessh
ID: 6955372
Dear yasinmon

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "pjknibbs"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 6979087
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 279
Socket Programming (Unix) 8 153
DCT of  2D array using fftw in c++ 9 89
FMX TEdit KeyUp handler detecting  "enter" key 4 36
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question