Solved

Platform independent or not

Posted on 2002-03-14
7
351 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

840 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