?
Solved

Platform independent or not

Posted on 2002-03-14
7
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 12

Accepted Solution

by:
pjknibbs earned 100 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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: 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.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

764 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