I'm sorry guys. I don't mean to step on anyone's toes, I accept that this is a *C++* forum, and therefore the threads should revolve around *C++*.
IMO there is nothing wrong however with learning alternatives to the status quo. I agree, the implementation of std::string is a wonderful thing, and I too wouldn't use anything else in a C++ program where there was heavy usage of *strings*.
I would say, learn C++ first, before C or any procedural lang. I see less problem with people migrating from OOP to lower-level langs than vice versa.
One of the first books I ever read on C++ was the one I mentioned. At the same time, I was in my beginning programming classes. In those classes, we used std::string. So I didn't give much credit to the string class the author develops, accept for it taught me something about classes (which I feel is not a bad thing).
In the other thread CornedBee, you said:
And how do you know how we learned classes?
I'm glad to say that I didn't learn classes by having people on the internet make me "consider" brain-dead designs.
You're right I don't know how you learned classes, but I would venture to say most people don't LEARN classes by designing very useful ones. I can recall one example I learned that was something like:
Code:
class cat
{
public:
cat(){ age = 0; }
void meow(){ cout << "Meow." << endl; }
void setAge(int a){ age = a; }
int getAge(){ return age; }
~cat(){ cout << "Screeeeeech! Thud!" << endl; }
private:
int age;
};
Is this a *brain-dead* design as you put it? Almost certainly. But it was one of those *baby-step* designs that helped me learn something about the structure of a class. It's merits I'd say are equal to that of a "Hello World!" program, not particularly useful, except as a learning tool.
So I would say to the OP, learn the difference between C and C++ (when you see something like <stdio.h>, let that be a hint...) C++ strings are good for C++ but non-existant in C. And almost certainly at some point, you will come across something claiming to be C++ but is really C, and for that reason alone, it might not be a bad idea to know what it looks like.