Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 206087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:36:51+00:00 2026-05-11T17:36:51+00:00

Question I have two compilers on my hardware C++ and C89 I’m thinking about

  • 0

Question

I have two compilers on my hardware C++ and C89

I’m thinking about using C++ with classes but without polymorphism (to avoid vtables).
The main reasons I’d like to use C++ are:

  • I prefer to use “inline” functions instead of macro definitions.
  • I’d like to use namespaces as I prefixes clutter the code.
  • I see C++ a bit type safer mainly because of templates, and verbose casting.
  • I really like overloaded functions and constructors (used for automatic casting).

Do you see any reason to stick with C89 when developing for very limited hardware (4kb of RAM)?

Conclusion

Thank you for your answers, they were really helpful!

I thought the subject through and I will stick with C mainly because:

  1. It is easier to predict actual code in C and this is really important if you have only 4kb of ram.
  2. My team consists mainly of C developers, so advanced C++ features won’t be frequently used.
  3. I’ve found a way to inline functions in my C compiler (C89).

It is hard to accept one answer as you provided so many good answers.
Unfortunately I can’t create a wiki and accept it, so I will choose one answer that made me think most.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:36:51+00:00Added an answer on May 11, 2026 at 5:36 pm

    Two reasons for using C over C++:

    1. For a lot of embedded processors, either there is no C++ compiler, or you have to pay extra for it.
    2. My experience is that a signficant proportion of embedded software engineers have little or no experience of C++ — either because of (1), or because it tends not to be taught on electronic engineeering degrees — and so it would be better to stick with what they know.

    Also, the original question, and a number of comments, mention the 4 Kb of RAM. For a typical embedded processor, the amount of RAM is (mostly) unrelated to the code size, as the code is stored, and run from, flash.

    Certainly, the amount of code storage space is something to bear in mind, but as new, more capacious, processors appear on the market, it’s less of an issue than it used to be for all but the most cost-sensitive projects.

    On the use of a subset of C++ for use with embedded systems: there is now a MISRA C++ standard, which may be worth a look.

    EDIT: See also this question, which led to a debate about C vs C++ for embedded systems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a bit of a silly question but; If I have two
I have a two classes: public class Question { public IList<Answer> Answers { get;
Actually, this question seems to have two parts: How to implement pattern matching? How
I have two String.printable mysteries in the one question. First, in Python 2.6: >>>
I have two tables (well, two relevant for this question) : Bets (holds the
Ok, NHibernate question here. I have two objects that I would like to map
I have a two part question Best-Practice I have an algorithm that performs some
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
Ok so part two of I have no will power experiment is: Summary Question
Background This question is in two parts. I have a one-way WCF operation hosted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.