Like Tree7Likes

Decision Making

This is a discussion on Decision Making within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Elysia Unfortunately not so in embedded systems where every KByte counts. I disagree. I can't speak about ...

  1. #46
    Registered User
    Join Date
    Oct 2006
    Posts
    2,545
    Quote Originally Posted by Elysia View Post
    Unfortunately not so in embedded systems where every KByte counts.
    I disagree. I can't speak about VC++, but G++ gives the option to exclude all built-in declarations/implementations, via the -fno-builtin command line option, and there are other options to strip it down even further, so that the only code that gets built is the code you write. in fact, the GCC family goes so far as to give the ability to create a flat, plain binary file, of the type you'd burn into a ROM chip. I'm sure VC++ and Intel's C++ compiler offer similar options, but I have no experience in trying to do that with those two compilers.

  2. #47
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Just adding iostream adds a lot of kbytes, you know? Which might be too expensive.
    But actually, I did not know of this option. This will certainly come in handy, so thanks for that.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #48
    Registered User
    Join Date
    Oct 2006
    Posts
    2,545
    Quote Originally Posted by Elysia View Post
    Just adding iostream adds a lot of kbytes, you know? Which might be too expensive.
    But actually, I did not know of this option. This will certainly come in handy, so thanks for that.
    I get your point, but the same could be said of including the C standard library in an embedded system. in my experience, it's much more common to implement your own iostream/stdio library that contains no more than the minimum functionality required for a given embedded system. including the whole standard library, whether it's C or C++, is probably the wrong thing to do for embedded programming.

  4. #49
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,915
    Still, the C I/O library, though big, takes up far less space than the C++ I/O library in my experience.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #50
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,752
    It is important to note though that much of the C standard (excepting the language grammar basically), including the libraries and main() and other things, only apply to hosted environments. Since embedded programming is frequently not on a hosted environment rolling your own I/O functions may be mandatory.

    Of course, good hardware has something to the effect of a library, usually.

Page 4 of 4 FirstFirst 1234
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Try again decision problem
    By hawkeye10 in forum C Programming
    Replies: 4
    Last Post: 02-03-2012, 03:08 AM
  2. The decision
    By Leeman_s in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 12-09-2003, 03:23 AM
  3. Tough decision - help!
    By da_fall_guy in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-31-2003, 10:10 AM
  4. Help - Decision in a do loop
    By dp174 in forum C Programming
    Replies: 3
    Last Post: 12-05-2002, 02:40 PM
  5. Help with some complex decision making
    By mlupo in forum C Programming
    Replies: 3
    Last Post: 11-17-2001, 01:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21