|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Quote:
Used to be that C++ required too much memory and processoring resources for practical use in embedded programming, but now the hardware is more than adequate (386 & 486 are common and megs of ram). Although all my embedded work is still in C (creaky ol' 80188), I do see from trade journals and advertisements that C++ is being used. Besides, when you write your test and monitor programs on the PC, you'd want it to be in C++. Also, I've seen a number of schools drop their C classes and teach C++ from the start. Just start out thinking of it as a "better C". |
|
#17
|
||||
|
||||
|
For a good reference, see http://www.oreilly.com/catalog/embsys/ where he talks about certain features of C++ that should be avoided (so as not to generate extra large code).
|
|
#18
|
||||
|
||||
|
Do you think there will be a transition from C to C++? If I became skilled in C++ would I need to remember all new library's, commands, etc. etc. if i wanted to persue C? Thanks in advance.
-andy
__________________
hmmm... |
|
#19
|
||||
|
||||
|
Primarily, C++ is an extension of C. C++ can use the same library functions as C. Except for a very few things, a C program compiles under C++ with no problem at all. Incompatibilities of C to C++ are so few that I cannot even think of what they are. As you start to learn C++, you will be learning C.
The main feature of C that is normally not used in C++ is C's dynamic memory allocation/deallocation. Instead of malloc and free, C++ uses new and delete. And using the struct and enum keywords are mandatory in C whereas it is optional in C++. No, you would have very few new things to learn when you shift from C++ back to C. |
|
#20
|
||||
|
||||
|
Re: why would anyone use assembly rather than c?
Quote:
Another note is that most people do not realize that even the best compiler cannot optimize all code, regardless of what your university professors tell you. So, if you need more speed, you do not necessarily have to convert to ASM. Take a look at this very simple example of code that is on the inside of a loop of a graphics effect I created: This gets 65 fps: for(k=0; k<=2; k++) c[k] += xinc[k]; Unrolling the loop gets 120 fps: c[0] += xinc[0]; c[1] += xinc[1]; c[2] += xinc[2]; The compiler couldn't optimize it at all. If I converted this into ASM, I could probably use MMX instructions to execute all three additions at one time. I bet there's no compiler that would take advantage of such instructions in this case. There are other simple examples that pop into my mind such as using a single dimension array when a 2-dimensional array seems to be required, but is not, such as storing a position in a game of chess or checkers. Just because you visualize it in 2D in your mind, it doesn't mean the computer has to access it this way.
__________________
Jason Doucette / Xona.com™ - Programming Windows Errata Addendum "Discussion is an exchange of knowledge; argument is an exchange of ignorance." |
|
#21
|
|||
|
|||
|
thanks for the info.
i'm still worried that i'd spend a lot of time learning something that would only give a small benifit, if any. but from what you say it is worth it. i do have a rediculous amount of stuff to learn at the moment, so assembly isn't high priority, but still not out of the picture as it were. there is something i find quite interesting about that sort of low level/bits type stuff. do you know of any good learning material for assembly? online or books or whatever? thanks ![]() |
|
#22
|
|||
|
|||
|
Re: Any experience with wxWindows?
Quote:
marron79: The only tools I know that will allow you to write once, an deploy on both Win/Mac platforms are Java and RealBasic. I know that anything with 'basic' in the name sounds to simple to be worth anything; but you might find what you need. I usually use C++ on a Linux platform -- but i hav used RealBasic for precisely the reason you shoul check it out: It is a qucik, easy, but fairly powerful OOP IDE that is write once, deploy both. URL |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > why would anyone use assembly rather than c? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|