Click to See Complete Forum and Search --> : What are the common libaries for C++?


Mancora
02-06-2004, 05:53 PM
Ok im a new C++ student and im somewhat confused by the C++ libary choices i can make, i keep thinking of java where there was _one_ libary, or at least thats all i ever had to worry about.


From what ive gathered...

Standard C libary, contains functions like cout, cin, and string, is this libary cross platform? Would i be able to compile this on a windows machine and then run it on a *nix platform?

Then there's the Microsoft Foundation Classes, MFC, which was made for programing for a windows interface by, as the name implies, microsoft.

Then what does C++ use for .net? It would need to be another libary right?

Then theres the windows API i believe, which is a more basic and lower level programming than the MFC?





And theres another libary, Form, or Forms, which i believe is what c sharp uses for .net, is there another libary for C# that doesnt requre forms so you can run your C# program outside of a .net framework?

gameboy1234
02-07-2004, 05:29 AM
Yeah, no wonder you are confused. First, as a student, you need to learn to educate yourself. That means when you hear about a "standard" you need to actually find and read that standard.

Now I don't have C++ standard myself, but the next best thing is The C++ Programming Language by Bjarne Stroustrup. It does have everything in the standard in that book, I believe.

Briefly, the standard C library is just that, the *C* library. It's definately NOT cin and cout because those are objects, which C doesn't do. The whole C library is function calls like printf. You can find all of these function calls in headers like: <ctime>, <cstdlib>, <cassert>, <cerrno>, <cctype>, <cwctype>, <cstring>, <cwchar>, <cstdio>, <clocale> <cstddef>, <csignal>, etc. Notice the starts with a c theme?

Cin and count and friends are defined in the standerd C++ library. You can find all of these classes defined in headers like: <iostream>, <utility>, <functional>, <memory>, <iterator>, <algorithm>, <exception>, <stdexcept>, <string>, <new>, <limits>, etc.

Stroustrup spends over 200 pages on the standard library so I ain't gonna be able to explain it all to ya here. Go read the book.

The standard template library is also part of the standard.

Then you have things like MFC and .NET and stuff that I refer to as vendor proprietary crapola. You're on your own there, sorry. Go bug Microsoft.

Mancora
02-07-2004, 03:30 PM
Originally posted by gameboy1234
Yeah, no wonder you are confused. First, as a student, you need to learn to educate yourself. That means when you hear about a "standard" you need to actually find and read that standard.

Almost all the stuff ive found has just talked about how to use X, not what X is. Ah well maybe im just natually slow and stupid.

bocybo
02-07-2004, 04:16 PM
If you want to learn ALL about the c++ standard library, there is only 1 book to look at:

The C++ Standard Library: A Tutorial and Reference (http://www.amazon.com/exec/obidos/tg/detail/-/0201379260/qid=1076188543//ref=sr_8_xs_ap_i1_xgl14/002-0500633-8001668?v=glance&s=books&n=507846) by Nicolai Josuttis.

It's easily the best on the subject.

rock
02-07-2004, 06:07 PM
As for the Windows libraries, if you're going to be writing Windows code, just get Visual Studio. The only version MS sells anymore is VS.NET, but you could probalby find VS 6 C++ cheap on ebay or something. The help/documentation will tell you anything you really need to know about MFC or the Forms classes.

gameboy1234
02-08-2004, 04:16 AM
Originally posted by Mancora
Almost all the stuff ive found has just talked about how to use X, not what X is. Ah well maybe im just natually slow and stupid.

No no no. That's why many people don't learn. What I'm saying is, don't assume you are stupid. Assume that if you don't understand something, then it's because all those people trying to explain it aren't saying the right thing.

In short, don't give up. Keep digging until you find the real answer.