Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 19th, 2004, 12:47 PM   #21
monkey8
Newbie
 
Join Date: Nov 2004
Posts: 12
Rep Power: 0 monkey8 is on a distinguished road
When you use
using namespace std;
It includes the whole std namepace. Try using just what you need
using std::cout;
using std::cin;
and see if that reduces executable size.
monkey8 is offline   Reply With Quote
Old Nov 19th, 2004, 4:08 PM   #22
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Eh? I always assumed that just enabled you to use elements of a template without having to type its name each time. The space is taken up with this line: #include <iostream>.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Nov 19th, 2004, 5:07 PM   #23
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 5 Eggbert is on a distinguished road
>I always assumed that just enabled you to use elements of a template without having to type its name each time.
It makes every name in the namespace visible in the global namespace without qualification. The names don't have to be templates.

>The space is taken up with this line: #include <iostream>.
Yes. The using directive only deals in visibility; it's the dependencies of the header that will effect file size. For example, if iostream also included fstream, string, and cstdlib then the translation unit size would be equivalent to the sum union of all of the header sizes. Also, the static library referenced by each header would be linked into the executable and the size would reflect that.

A well written library will minimize dependencies to speed up compilation and shrink translation unit and executable file sizes, but not all standard library implementations are that good.
Eggbert is offline   Reply With Quote
Old Nov 20th, 2004, 11:11 AM   #24
Dia_Byte
Programmer
 
Join Date: Nov 2004
Location: Bierut - Lebanon
Posts: 34
Rep Power: 0 Dia_Byte is on a distinguished road
well all these are good sugestions that i intend to try one by one to have the best benefit of C++

its confusing how a famous language like this can cause much trouble :blink:
__________________
<removed by Administrator>
Dia_Byte is offline   Reply With Quote
Old Nov 20th, 2004, 11:32 AM   #25
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 5 Eggbert is on a distinguished road
>its confusing how a famous language like this can cause much trouble
Quality of implementation issues exist everywhere. It's most evident with languages like C and C++ that are very popular and have many different implementations of the standard language (both open source and retail). If you can't find a way around the problem then complain to the vendor. Header dependencies are their mistake and they should fix it. You shouldn't have to switch from C++ to C just to get smaller binaries.
Eggbert is offline   Reply With Quote
Old Nov 25th, 2004, 10:00 AM   #26
Dia_Byte
Programmer
 
Join Date: Nov 2004
Location: Bierut - Lebanon
Posts: 34
Rep Power: 0 Dia_Byte is on a distinguished road
well i'm really thinking about mailing DEV_CPP creators maybe they'lle find a sollution !
__________________
<removed by Administrator>
Dia_Byte is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:54 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC