Posts: 691
Threads: 5
Joined: Apr 2002
Quote:gcc certainly isnt the best. At least it aint better than msvc.
Gcc doesn't produce the fastest code by a long shot, compilers creating by the chip manufactures (Intel and AMD both have super fast optimising compilers for their chips) do this. Gcc's strengths are that it is highly extensible, portable and open source. MSVC's biggest weakness is that it produces code for only one operating system line and a very limited number of architectures.
I havent compared output code size and executable speed between gcc and msvc, so I cant comment on that, however I personally use gcc because I am more interested in portablility of code and its open source nature than in ultra fast executables.
esus saves.... Passes to Moses, shoots, he scores!
Posts: 358
Threads: 15
Joined: May 2003
Quote:Gcc doesn't produce the fastest code by a long shot, compilers creating by the chip manufactures (Intel and AMD both have super fast optimising compilers for their chips) do this.
The numbers I've seen indicate that the intel compiler is circa 0 to 30 % faster than gcc. Not a huge difference (1 sec vs 1.3 sec wait for some process)
However, LC knows much more than I do ;-)
I've been learning on dev-c++(an IDE for windows based on mingw, a windows port of gcc). If you include <iostream>, the exe will be circa 420 kb, minimum. If you run the "strip -s yourfile.exe" utility (in the bin directory of dev-c++), it will make the min size circa 200kb. The code will scream compared to QB. circa 15x faster on my machine.
Posts: 1,057
Threads: 156
Joined: Aug 2003
i am using turbo C++ 1.01 and i cant get this to work
Code:
#include <iostream.h>
main ()
{
printf ("hello world!\n");
}
it syas t cant open the iostream.h
i have not tucked any of the files, it is as it was after being installed
Posts: 1,752
Threads: 21
Joined: Jun 2002
printf is a function of stdio, not iostream. If you want to use iostream, use cout. If you want to use printf, include stdio.h
Code:
#include <iostream.h>
main ()
{
cout << "Hello World!\n";
}
Code:
#include <stdio.h>
main ()
{
printf("Hello World!\n");
}
Also note that if you use cout (C++), you have to save your program with a .CPP extension BEFORE running it.
Posts: 1,845
Threads: 44
Joined: Aug 2002
Quote:it syas t cant open the iostream.h
Are you running from dos? Since the name 'iostream' is larger than 8 characters, it is not a valid dos name, which I had in DJGPP. Try running from Windows, or using stdio.h in dos.
Posts: 358
Threads: 15
Joined: May 2003
Quote:Diroga Wrote:it syas t cant open the iostream.h
Are you running from dos? Since the name 'iostream' is larger than 8 characters, it is not a valid dos name, which I had in DJGPP. Try running from Windows, or using stdio.h in dos.
Code:
Neo, what's the problem with iostream?
iostream.h
12345678.1
max for DOS is
12345678.123
Posts: 6,419
Threads: 74
Joined: Mar 2002
What is more, DJGPP likes long filenames if it is ran in a DOS box under windows.
Posts: 1,057
Threads: 156
Joined: Aug 2003
it said it couldnt open stdio.h and printf needs a prototype in main()
Posts: 6,419
Threads: 74
Joined: Mar 2002
Configure your paths. I think that's the problem.
Posts: 1,057
Threads: 156
Joined: Aug 2003
ok so it was a directory thing, but now it says it can make the *.obj file