+ 3
I have a doubt in Embedded-C and C programming language..... Please clarify my doubt......
//EMBEDDED - C In Google,I found that Embedded-C is considered as the "HARDWARE DEPENDENT LANGUAGE". Then how does the embedded C (code) is works properly for different hardware architecture(i.e Embedded-C portability) Without any changes made on that code... --------------------------------------------------------------------- //C - Language I also found that C(code) is considered as a "PLATFORM DEPENDENT" Then how does the C(code) works properly on all systems (like Linux,Mac) not only in Windows...... How does it work properly.... Please tell me
10 Answers
+ 5
Yogeshwaran in embedded system C and C++ used for many tasks and projects as fault tollerance and hard real system required accuracy which is acheived most by C and C++ as being close with hardware and assembly.
In embedded C code is embedded and mounted over hardware like arduino and rasbaperry pi with burninh the code with USB.
C code is considered as platform dependent but in embedded design it is compiled over an cross compiler according to work requirements that cross compiler will generate burnable file which is mounted at hardware and that hardware is consist of micro controller which work like an OS and this way the task is completed in embedded environment.
This is just an basic step for small programs and tasks for bug fault tollernce system more mechanism is invilved witj system specific requirements according to necessity
+ 4
You are talking about writing a piece of code and then compiling it and then executing it which will obviously work for all OS.
I'm trying to explain that the compiled version of a code on a particular OS cannot be executed on some other OS.
+ 4
Yogeshwaran , this is just a clerification of what Avinesh already said.
the source code that you write will remain same for all the platforms throught the world but the code which is generated after compiling the source code will be platform dependent. That's why same program have to recopiled on another platform to work. For example If you try to run the same executable compiled on windows will not work on linux.
+ 3
Java is platform independent mainly because of it's intermediate state which is the bytecode or the .class file.
This bytecode could be executed on any operating system given that the system has a JVM which is of course OS dependent.
But this is not same for C language because the the compiled .exe file is specific to that OS on which it was generated. You cannot execute the same file on a different OS.
+ 2
For that you can refer the answer by DishaAhuja. She has explained it in much detail.
You can also refer this answer which says the same thing.
https://stackoverflow.com/questions/11810484/is-c-platform-dependent
+ 2
+ 1
Avinesh then how does the C code works on Some os like Mac,Linux(sololearn),....
Without working alone on windows.....
+ 1
Avinesh I agree with yours first case explanation....
Can you explain detaily about yours second case.....
Because I can't able to differentiate yours first and second case answers.....