i am thinking about learning C++...what compiler do you think i should start with?
Printable View
i am thinking about learning C++...what compiler do you think i should start with?
Borland's command line compiler :)
It's a 32-bit windows compiler, so it should be fine for you - see the FAQ :)
I like either the command line compiler, or VC++
VC++ Sucks, it doesn't do partial template specifications :p
But I think you're the only person in the world (other than Stroustrup) that would actually use them :pQuote:
Originally posted by kedaman
VC++ Sucks, it doesn't do partial template specifications :p
:D
i don't even know what they are :(
kedaman... does anything else? =).
Z.
good ol djgpp will get ya through it. =)
Haven't had any problems with it yet...but then again, i'm just starting out with C++.
djgpp is a dos compiler, so you'll get problems once you want to make real windows apps.
Keda: do you mean this thing:?
??Code:template <int S> class Y
{
enum {V = S}:
}
template <class T> class X
{
int i;
X() {i = T::V;};
}
Well, who uses those? It's against the idea of templates: they are meant to be used for ANY datatype! You can use macros instead, but they're not good as they are not typed:
this initializes any DirectX structure that needs a size:
I admit I'd prefer:Code:#define DD_INIT(s) \
memset(&s, 0, sizeof(s)); s.dwSize = sizeof(s);
But such things are rather seldom...Code:template <class dd>
inline void DD_Init(dd s)
{
memset(&s, 0, sizeof(s));
s.dwSize = sizeof(s);
}
macros are bad, they pollute the scope of the names, and are just doing replacements in the code, templates instantiates functions and classes for specific purposes, something you can't achieve with macros. It's part of the generic programming paradigm which generilize and enhance both object oriented and functional programming into a more device independent form of programming.
And no I didn't mean those. I meant template specification, I posted a partial evaluation sample a while ago which evaluates the power of a value at compiletime, which wouldn't have been possible in MSVC since it needs all parameters to be specified for a specification to take place, not the hierarchic specification (yes Zaei there is a page out there if you search on Partial evaluation) which at least some other compilers support (If only the search engine would work i can find the post for you) anyways I found a workaround but that workaround is only practical for cheating MSVC to reset all parameters to do a specification. It's no solution for doing partial specification in general.
aah, so you mean the thing with pow...
Yep, Pow<3,4>() would evaluate to 81 :)
well, I found this:
Seems you're using the wrong compiler for your fancy tricks.Quote:
NOTE: Visual C++ 5.0 does not support template class partial specialization. The above sample causes compiler error C2989: template class has already been defined as a non-template class.
I am using Visual C++ 6.0 and I get the same error.
Yeah, it seems that MS didn't corect it in 6.0! Boohs to MS! They're not ANSI-compliant! :mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad::mad: :mad::mad:
.NET Beta 2 is out there, maybe they have corrected it?
CB - Of course they're not ANSI compliant, very few compilers actually are.
The only thing i dont like about DJGPP is that it automaticly puts the protected mode thing on it. Is there a way to have it make just a normal dos real mode app?
thanks guys...overal??
for all practical purposes, VC++.
Chimp: who WANTS to program real mode? Using segments and near and far pointers *shiver*
I would if it means the exe will be 3 kb instead of 150 kb.
It's inefficient to keep switching the processor from real to protected mode.
This is why writing 32-bit apps that don't need Windows or another host DPMI takes so much space - they need a server to run them properly so that they behave themselves.
I think under Unix you can get an asm program down to under 1K.
thatnks guys
why is everyone so obsessed with loosing like 50k? i can see if the program is going on a floppy disk, but otherwise, it's just for show.
You know, if people would actually worry about 50k, then computers in general would be so much better.
Too true... save 50 kb on every file, and youd get a whole lot of memory savings. There is no reason for, to be specific, images should take up so much room. For most purposes, only the R, G and B colors are required for an application, so why not remove the extra byte? Parse the file manually at load, and get the correct color. It isnt hard.
Z.
i guess so. i just think a lot of times, it is a waste of time.
Lets go and talk to Microsoft... ;)Quote:
Originally posted by ChimpFace9000
You know, if people would actually worry about 50k, then computers in general would be so much better.
Anyway, if you're writing a boot loader then you HAVE to worry about size (what is it, 2 sectors or something?)
I know, i was thinking of that too, that is why i didn't say "always".
let me rephrase....
When you are writing a HUGE app, 50k doesn't matter.
Im gonna have to disagree with you again. When writing anything, 50k does matter. Im willing to let 5k go though.
this is the reason why, when using windows, you should rather use console apps than real DOS apps...
Yeah... Saving space is a good thing. I have 7 DLLs and an EXE for my current project, and building them in debug form, I am taking up the same amount of space as Win 3.1. One of my log files is 8 megs or so, for ~30 seconds of game play(this is also a condensed format, the full HTML log was ~37 megs). So, I am guilty too, but it's OK, cuz its just debugging =).
Z.
What do you mean? They are two different things...Quote:
Originally posted by CornedBee
this is the reason why, when using windows, you should rather use console apps than real DOS apps...
I mean: for learning C++ and doing things like simple cout and such, you should rather use console apps than real DOS apps.
For GUIs, you should use real windows apps rather than graphic mode DOS apps. This is because they can then use a dll for the CRT and such. Also, you've got flat address space without the protected mode switch.