Page 1 of 1

What are different between MikroC and C++ ?

Posted: Wed Apr 25, 2012 11:19 am
by Nandika
Hi Friends,

I have a problem as previous. :( :)
I kike to be a person who has good knowledge about System Embedded technology.therefore,Now I am learning C++ language.But,some say C++ not want for System Embedded Programming. :? :?: :(
So,I want to know about C++ and MikroC.what are different between this tow languages?[Actually,are those tow languages?]
As I know,C++ language is a common language for every C base languages.Am I correct?

English is correct include [] marks? :geek:

Thanks my friends.

Re: What are different between MikroC and C++ ?

Posted: Wed Apr 25, 2012 9:54 pm
by SevenZero
Don't worry about what people with fewer knowledge say about C/C++. Basically about 75% of whole world is using C/C++ general application programming. 100% of the world uses C/C++ for system programming (Operating System programming). Again 85% of the world uses C/C++ with Assembly to program core level embedded development.

But it is true some people say Java is used. But Java can only be used when there is an OS such as Android. So in simple terms Java is not doing well on embedded. C and Assembly is the greatest blend.
So,I want to know about C++ and MikroC.what are different between this tow languages?[Actually,are those tow languages?]
Both C and C++ as languages with little differences have separate ANSI standards. Lot of companies such as Microsoft, Intel, Nokia, etc... have made their own C/C++ compilers. Mickroelectronica is such a good company who are in to embedded made their own C/C++ compiler called Mikro C. So it is a company and their own compiler for embedded platform.
As I know,C++ language is a common language for every C base languages.Am I correct?
C++ is an extension of C language. That means C++ has some additions. Great support for OOP is one of the significant additions to C++.

Don;t worry much about C and C++ for now. Learn C++ and you will be able to work on embedded ;)

Re: What are different between MikroC and C++ ?

Posted: Thu Apr 26, 2012 8:20 pm
by SemiconductorCat
Please go to the Red Marked Short Answer if you except Short answer and don't need to read my crap.

yes true , if your a beginner to the C/C++ world then you could throw away the differences and safely
learn your own way.

For your information:
But fact wise there is a difference, C won't become C++ and these two specification were
maintained by two separate working groups. C is known as high level assembly language.Some developers feel
it's easy to deal with "C" than C++. Because C++ adds some messy things that can't be fixed into the system level.
For a example your writing a call gate transfer routine [SwitchRoot()] like procedure , then you disable all interrupts
,then your code throws an exception, but your ABI implements exceptions via interrupts, so that interrupt will
simply be ignored. Because some syntatic magic in C++ won't come as magic in system level, there is a issue.


I have seen embedded programming IDE's and SDK's which use C++ developer environment. And there , it's ABI
is completely defined. So in that case it's not messy.
There is a debt going on here: http://stackoverflow.com/questions/2226 ... ons-or-not
^- it's school of taughts and I don't need that. I want to go more factwise,you better read that,but don't bring that
debt here.

FYI: Today most of the embedded platforms support full C++ features, Here is the ARM7 EABI[extended Appliation
Binary Interface] document. (ARM7 is the fav proc of Saman).
http://infocenter.arm.com/help/topic/co ... cppabi.pdf
according to their ABI , they implement exceptions using classes hierarchy. (like in java).
But some other compiler GNU ARM toolchain may implement it another way. Personally you won't met a case
that you need to use two C++ compilers from two toolchain's.But there are incidents you may have to use
one toolchain's C++ compiler and some other's assembler. In a case like that there may be serious binary
incompatibilities. Then you will have to fix the incompatible code in advance.


And I have to add this too. Almost every compiler have some extensions to the pure ANSI C++ language.
Even GNU C++ and Visual Studio C++ also adds these extensions.A good example is '__dllimport'.
__attribute__(()), and you could turn off and on this behavior as you need.
In some embedded compilers I have seen 'interrupt' is a reserved keyword or an annotation like 'main'
method. So there are many instances that you can't simply deal with your C/C++ knowledge. There are
many instances that you need to go and dig into the ABI and user manuals.

They have tried harder to make your C++ environment as pure as they could. But there are certenly places
that you needed to dig in. I could take the __config macro as an example.

Code: Select all

/* Register CONFIG2 (0x157fc)                               */ 
#define _CONFIG2(x) __attribute__((section("__CONFIG2.sec,code"))) int _CONFIG2 = (x); 
^- so in SDCC it have defined config with an __attribute__, so there is nowhere you could escape from the
reality.


If you feel somewhat messy my above facts better just ignore it , and ramp up your C++ skills first and come
back here.Go on your own way, but remember C and C++ are two different. Even their front ends are not same.
When you working very closely to the linker editors etc etc, C over C++ make your eyes more obvious.But my
personal idea is it won't hurt your embedded development, it come into a pain when you writing and maintaining
operating systems where binary standard is a issue.


Short Answer

>> As I know,C++ language is a common language for every C base languages.Am I correct?
As I already given the answer,yes it is. ANSI C++ is a well defined specification /standard which is unique among all
the computing universe. But the problem is we couldn't live only with that. Because of that your compiler implements
some additional extensions to support your environment. But those dirty parts are encapsulated and your compiler
vendor is trying hard to present their compiler as pure C++. And yes Learn C++ as in general and it will help your
embedded programming.

>> Now I am learning C++ language.But,some say C++ not want for System Embedded Programming.
In embedded programming no, you could use complete C++ with it's complete features. exceptions , templates,
classes an all features. But there will be few instances where you need to turn up and read the ABI. Don't worry
C++ extensions are completely supported by embedded programming.

>> So,I want to know about C++ and MikroC.what are different between this tow languages?[Actually,are those tow languages?]

ANSI C++ is a computing standard, and MicroC is a compiler,it's a vendor name.
But there are extensions to support some crap.If you find this messy just ignore this for a moment.

>> I kike to be a person who has good knowledge about System Embedded technology.therefore,Now I am learning C++ language

C/C++ is like just 'ABC' in computing. It's like a language spoken. Without that language, you can't read a book
which is written in that language. So yes learn it , it helps.

--thanks for reading this--( I would like if you read my long answer even with some difficulty)
sandun.

Re: What are different between MikroC and C++ ?

Posted: Thu Apr 26, 2012 9:05 pm
by SevenZero
Sandun, your long answer is good if Nandika knows at least another language. But you obviously know Nandika is a beginner. So I find your answer is good but scary for a beginner. So I would like to ask everyone to support people with a supportive mentality. Our aim is to get more and more people from rural areas to industry. So let them start, learn step by step and become professionals. Nandika is already professionalising electronics. So if he can learn a bit of C & some Assembly with some understanding on microprocessors, memory, etc..., I'm sure he can reach his goal.
ROBOT.LK's only aim is to support people who have technical matters and lacking access to technology resources. People like you who have access to facilities such as libraries, laboratories, etc... have lot of chances and alternatives.
But our aim is not that. ROBOT.LK had been started to reach such talented people somehow and help them to come in to industry.

Nandika, you are going on the right direction. Good luck!

Re: What are different between MikroC and C++ ?

Posted: Sat Apr 28, 2012 7:50 pm
by Nandika
Thanks both,SevenZero and Sandun....

I understood about C/C++ that I want limit yet.
Actually,Now I have a solution for my question.Now, I know different between C++ and MikroC.And,Those answers are provide me solution for several problem.But,Automatically create additional problems. :shock:
Sandun's long answer is good.But,some are :geek: .However,I will be useful it for me.it's sure. ;) it's short unit is very good.

ZevenZero,I like for challenges.I accept Sandun's long answer as a challenge.
Your answers are very good.Actually,Your system is good.

Again,Thanks both my friends.
I have to go long tour with both of you. :D :D :D

Re: What are different between MikroC and C++ ?

Posted: Sun Apr 29, 2012 11:24 pm
by SemiconductorCat
>> ZevenZero,I like for challenges.I accept Sandun's long answer as a challenge.
Your answers are very good.Actually,Your system is good.


I'm not challenging you , but if you think the subject context as a challenge then
it's good. Someday in the industry your going to need those things.So nothing will
be a waste. Learn it. It's required. However if you feel you need some basics and
some practice before touching those things. Or do it mix.

And when you reading something like C++ ABI for ARM , after you read it, then reading
another ABI [ linux ELF] will be a nothing.

First you will feel this as a challenge , then you'll feel this as your life.Warning
you going to be addicted to this !

Re: What are different between MikroC and C++ ?

Posted: Mon Apr 30, 2012 9:35 pm
by Nandika
SemiconductorCat wrote:

I'm not challenging you , but if you think the subject context as a challenge then
it's good.
I never think as you said. :o :o you newer challenge me brother.But,you are challenge me as I think. 8-) 8-) :D
Real challenge is as you said,this subject context. :|
SemiconductorCat wrote: And when you reading something like C++ ABI for ARM , after you read it, then reading
another ABI [ linux ELF] will be a nothing.
What is ABI?Shuld I learn it now?
SemiconductorCat wrote: First you will feel this as a challenge , then you'll feel this as your lifewarning
you going to be addicted to this !
Now,I'm in Bold step... :D :D :D ,as i think.
I really want to go forward.In C/C++ and Electronic fields.
Thank you for Help me...I must thank you,because,you dedicate your valuable time,resources,... for me.
Also other friends... :)

Re: What are different between MikroC and C++ ?

Posted: Sat May 05, 2012 7:27 am
by SemiconductorCat
Nadika it's completely oky.sorry for the late reply. And I accidently remove some rep points
from you. However I noticed it and I think I replaced it. Don't discouraged. C++ is a very big
world.

But about the challenge , there are places that you could give up some challenge.
http://www.ioccc.org/

^- if you could read the code and understand the code there,then you probablly a world class
C programmer. Some code there are C++ too.
I'm personally not in that level of expertise ,so I decided to continue my learning.
Anyway doing a challenge is not a crime.

And C++ world is more bigger than you imagine. So take up any amount of space that you need
in your room. So to your question, yes if you could read ABI , then go on. Simply ABI explains
these things in brief.

1. How the name decoration is going on.
2. How exceptions and assertions were implemented.
3. How classes are structured in the memory and how compiler will deal with the virtual functions.
4. How compiler deal with dynamic typecasting and RTTI ( Runtime type information).

When you read a C++ ABI for a particular environment (ex - EABI , for embedded applications ),
you are more confident and transparent with the code that you write and read. And also it will be a
good exercise for you because ,programming means 90% of reading and 10% of writing new code.

So keep reading the ABI's when your free, ex- When you traveling in the bus, you could keep
a copy of your interested ABI. More knowledge , more your demand to the company, if you
think about money and a good job, then forget about the challenge or iocccc thing and try
to increase your value and demand for a particular company and their technology stack.
So if you want to challenge there are tons of people out there who are waiting for a challenge.
Anyway for me , become a person like 'neo' and have a well paid job [at least 90K annual ] is
the objective.Simply follow the path that Neo like person [you will find neo like people all around the
internet communities and IRC] and be a one like them.
For me Money is the everything , for a challenger their challenge is their life.But challenge is
not a crime either ,but decision is yours !.

Best of luck.Don't get discouraged, and even don't think more about those rep+, simply
all the profiles I seen on the net are just fake[internet dude's].However I have add you more reps than I
accidently removed.

Re: What are different between MikroC and C++ ?

Posted: Fri Oct 12, 2012 3:32 pm
by johor
C is a assembly language and C++ is also assembly language....

Re: What are different between MikroC and C++ ?

Posted: Fri Oct 12, 2012 8:12 pm
by Neo
johor wrote:C is a assembly language and C++ is also assembly language....
Not a good explanation. It is good to say C can be compiled to assembly and C++ can also be compiled to assembly.