Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another one... 1

Status
Not open for further replies.

vbkris

Programmer
Jan 20, 2003
5,994
IN
to use something like this:
string a; i need to include iostream.h...

the problem is the .exe file size shoots up to 139K (even if the main simpy prints the value)...

is there any way to reduce this size?

in C is scanf inbuilt or even there does it depend on an include?

Known is handfull, Unknown is worldfull
 
i believe scanf requires you to include stdio.h
i dont know answer to first question. i know in Java that you can include just a part of a library instead of all of it
 
thanks...

Known is handfull, Unknown is worldfull
 
Apropos, you must include <iostream> (not <iostream.h>) when use <string> STL header. I have 52K VC++ 6.0 RELEASE module with simplest { string s(&quot;Hello, World!&quot;); cout << s; } &quot;application&quot;. Yes, DEBUG mode module is much more expensive, but it's debug. Well, additional library code shares space with your code (write BIG useful codes and get it out of your head run-time library code percentage;).
 
Try using:

#include<blah> -instead of- #include<blah.h>

then say:

using std::whatever;

For example:

#include<iostream>
using std::cout;


Will enable you to use output operator cout like:

cout << &quot;text&quot;;

I'm not 100% certain that restricting what you use within a namespace will reduce the file size, but I believe that it is your best hope.
 
using std::whatever will not reduce file size. The best way to reduce the file size is to strip debug info from the executable. Also, if you're not already, you can find and use a dynamically linked version of the C++ library.
 
I learn something new every time I visit this forum. Star from me, chipper.
 
ah!! i am still not so advanced (to strip debug info from exe) can u tell me how to do that.
i use Borland C++...

Known is handfull, Unknown is worldfull
 
o.k i will check on it and come back...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top