Platform-Independent code, is a code that can run on any Operating System. So to write Platform-Independent codes, don't use codes that can work ONLY in the OS you program it in. w4r3_w01f at live dot com
No. (Of course you should specify what compiler you are talking about.)
Oh, dude, let me break it down for you. C is a platform-independent language because it can be compiled and run on different operating systems like Windows, macOS, and Linux. So, like, you can write your C code once and run it on various platforms without having to worry about compatibility issues. It's pretty chill like that.
Well, C is not platform dependent. You can compile C into source code on a Windows, Mac, Unix or any other operating system as long as you are using that type of computer. You could write code that can be compiled on almost any operating system. But the programs you write may or may not be able to move from system to system based on whether or not you use tools specific to that operating system. Java is not actually platform independent either because you need JVM to run it. It's just that most computers come with JVM installed. Both of the above are wrong. The C language specification itself is platform-dependent, as there are numerous places where ambiguities (both intentional and unintentional) cause different behavior according to how both the platform AND the C-compiler writer chose to behave. Thus, while it is possible to write a C program which is highly-portable, that program is still dependent on the exact implementation of the C compiler and OS it runs on. So, the behavior of a C program depends on the platform. The Java Language is platform INDEPENDENT, since it does NOT have the implementation ambiguities of C, and has a completely-standardized interface to all platforms (the JVM spec). Naturally, the JVM program is plaform dependent, as creating it to conform to the Java VM specification requires knowledge of the peculiarities of the platform.
No. The term platform independence in Java does not mean that any other programming language cannot be run in multiple OS platforms. Actually platform independence means that the java code can be run in multiple platforms with little or no customization. The code that can execute in a Windows platform can run as it is in a Linux box, whereas other programming languages need to be customized based on the platform they will be implemented in.
C source code is portable; it can be compiled upon any machine with a suitable C compiler in order to produce the machine-dependant code (the machine code). However, C can also be used to write machine-dependant code, or code that is dependant upon specific platforms. In order to be completely portable, the code must use the C standard library and/or generic libraries.
No. (Of course you should specify what compiler you are talking about.)
Oh, dude, let me break it down for you. C is a platform-independent language because it can be compiled and run on different operating systems like Windows, macOS, and Linux. So, like, you can write your C code once and run it on various platforms without having to worry about compatibility issues. It's pretty chill like that.
c is platform dependent
WHY MEANS the java is a platform independent language for the sake of it has its own platform to run the program it doesn't require any platforms like c and C++
The language itself is platform independent. However, specific implementations may be platform dependant. For instance, code written with Microsoft Visual C++ is generally intended to be compiled upon Windows platforms only, not Linux or Mac platforms. Although pre-compiler directives can filter machine specific code to suit the current platform, programmers need to be careful to avoid implementation-specifics when porting code to other compilers. If code is intended to be portable, it's better to use an implementation that conforms to the ISO standard, and that has implementations for all the intended platforms to accommodate platform-specific code.
Well, C is not platform dependent. You can compile C into source code on a Windows, Mac, Unix or any other operating system as long as you are using that type of computer. You could write code that can be compiled on almost any operating system. But the programs you write may or may not be able to move from system to system based on whether or not you use tools specific to that operating system. Java is not actually platform independent either because you need JVM to run it. It's just that most computers come with JVM installed. Both of the above are wrong. The C language specification itself is platform-dependent, as there are numerous places where ambiguities (both intentional and unintentional) cause different behavior according to how both the platform AND the C-compiler writer chose to behave. Thus, while it is possible to write a C program which is highly-portable, that program is still dependent on the exact implementation of the C compiler and OS it runs on. So, the behavior of a C program depends on the platform. The Java Language is platform INDEPENDENT, since it does NOT have the implementation ambiguities of C, and has a completely-standardized interface to all platforms (the JVM spec). Naturally, the JVM program is plaform dependent, as creating it to conform to the Java VM specification requires knowledge of the peculiarities of the platform.
No, M$ Windoze only.
C++ has no generic graphics methods whatsoever. All graphics are platform-specific and therefore require a suitable API and library to support your specific platform and hardware. Thus there is no generic C++ code for 2D animation let alone 3D animation.
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
Well, C is not platform dependent. You can compile C into source code on a Windows, Mac, Unix or any other operating system as long as you are using that type of computer. You could write code that can be compiled on almost any operating system. But the programs you write may or may not be able to move from system to system based on whether or not you use tools specific to that operating system. Java is not actually platform independent either because you need JVM to run it. It's just that most computers come with JVM installed. Both of the above are wrong. The C language specification itself is platform-dependent, as there are numerous places where ambiguities (both intentional and unintentional) cause different behavior according to how both the platform AND the C-compiler writer chose to behave. Thus, while it is possible to write a C program which is highly-portable, that program is still dependent on the exact implementation of the C compiler and OS it runs on. So, the behavior of a C program depends on the platform. The Java Language is platform INDEPENDENT, since it does NOT have the implementation ambiguities of C, and has a completely-standardized interface to all platforms (the JVM spec). Naturally, the JVM program is plaform dependent, as creating it to conform to the Java VM specification requires knowledge of the peculiarities of the platform.
Yes. Code must still be written specifically to suit each platform, however C++ itself is not platform dependant. To port code between platforms, the source code needs to employ compiler directives (#ifdef/#ifndef) to filter the required code to suit the current platform, and the code must be compiled separately upon each platform. By contrast, Java need only be compiled once on any platform, and the resultant byte code can then be interpreted and executed upon any machine that supports a Java Virtual Machine implementation. This makes it much easier to produce cross platform applications, but performance will suffer as a result of the interpretation.
You use Visual C++ when you wish to write C++ programs specifically for the Windows platform and which can only be guaranteed to compile on Visual C++. Although it is possible to write cross-platform, portable code in Visual C++, it is not standards-compliant, which means you either avoid non-standard code altogether or use precompiler directives to cater for other compilers. You use C whenever you need to write low-level procedural programs for any platform. Since C++ evolves from C, you can write C-style code in C++ (including Visual C++). C instructions can be mapped 1:1 with the equivalent assembly code, so it's the language of choice for low-level coding without the complexities of assembler. However, since C++ evolved primarily from C, you can achieve the same thing using C++ by utilising C-style programming, or even mixing standard C programming with C++ code. The latter requires precompiler directives to ensure standard C code is compiled using the standard C compiler. C-style programming is not quite the same as standard C, but is part of the C++ standard. Standard C has its own standard.