Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ Compilers

Name: Anonymous 2007-05-16 19:55 ID:x12eicKY

Alright I've been programming in Java for over 3 years now and feel it's time to switch to C++.  In Java I used an assortment of IDEs, but stuck with Eclipse once I found it.

So, I've gone through about 5 different C++ compilers (Dev C++, Turbo C++, to name a few) and was only to get one Hello World compiled without any clue how I got it to work.  I also tried the Eclipse CDT but that also didn't compile.

I'd hate to say it, but Eclipse making it so easy to compile Java code has made me very dull when it comes to these things.  So what I'm asking is if someone can suggest a compiler and go into the process of compiling in C++.  I hear things about makefiles and .o files, but I'm not really sure what it means.  Any help would be grateful.

Thanks in advance.

Name: Anonymous 2007-05-18 16:26 ID:2xsWPLgG

>>21
C++'s "generics" are based on templates, which are just a convenient way to avoid writing the same thing twice, thus

template<class Type>
Type harbl(Type a, Type b){
  Type tmp;
  // harbl the harbl a bit, or just do something
  return tmp;
};

....
int e = harbl<int>(f,g);
float f = harbl<float>(a,b);

is just a convenient way to avoid writing the function harbl twice. The template implementation doesn't include anything that would make it unsuitable for a low-level language, it's basically a smart preprocessor that in this case generates separate code for both harbl<int> and harbl<float>.

The objects have their problems, sure, but those are not _that_ common unless you're using the language like an enterprise Java/C# programmer and the code turns into a mess of randomly glued together objects in the absence of any design effort.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List