Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
starting C++
#21
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!
Reply
#22
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.
Reply
#23
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
Reply
#24
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.
Reply
#25
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.
Reply
#26
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
Reply
#27
What is more, DJGPP likes long filenames if it is ran in a DOS box under windows.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#28
it said it couldnt open stdio.h and printf needs a prototype in main()
Reply
#29
Configure your paths. I think that's the problem.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#30
ok so it was a directory thing, but now it says it can make the *.obj file
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)