The hello world and the tab like cout << "The sum of 2 + 2 is:\t" << 4 << endl;.........What should I learn now? btw I can't wait to start college for CS in july :)
Printable View
The hello world and the tab like cout << "The sum of 2 + 2 is:\t" << 4 << endl;.........What should I learn now? btw I can't wait to start college for CS in july :)
>What should I learn now?
:eek: Your mastery of C++ is astounding! To be honest, there's nothing left to learn, so you can go ahead and write an OS or a compiler, or the next blockbuster game. :)
But seriously, try learning the myriad ways of getting input with C++. That should give you a very strong foundation in input streams.
Ok will do yay ......also, I am now actually understanding what tutorials and ebooks for C++ are talking about which is what makes me excited.
Not much is more exciting than that "Aha!" moment. Be careful, because it's very addictive. ;)
Yeah I have already hit that moment when the arrows on cout should be << not >>.
a good book:
"C++ Without Fear" by Brian Overland (I think that's his name)
Get a feel for data types before anything. It might seem trivial and boring for you, but you'll thank yourself later.
Master control statements (if, if/else, if/else if/else, for, while, do/while) -if variables/data are the NOUNS in C++ then control statements are the VERBS...
Functions -what they are, what they're used for, why they're useful, etc.
EXAMPLE, AFTER EXAMPLE, AFTER EXAMPLE!!!
give yourself programs to write, challenge yourself, learn everything you can!
POINTERS!!! -nuff 'said.
learn structs & classes. what they are, what they do, etc.
learn to implement the STL (Standard Template Library) this includes (vector, list, iterator, etc.)
then, give yourself more assignments & more challenges!
>> a good book: "C++ Without Fear" by Brian Overland
From what I've seen this is not a good book. It teaches bad habits (like C style strings and plain dynamic arrays). There are other books available that don't have that problem that I would probably look at first.
>> It builds on C-Style strings to teach you how to develop a string class (not a bad example by any stretch of the imagination).
Does it teach you to use the C++ string class for your string needs? If not, then it doesn't matter whether it uses C style strings for developing a string class, because the reader of the book will develop the bad habit of using C style strings instead of C++ strings.
>> plain dynamic arrays?
Bad:Good:Code:int* dynamic_array = new int[count];
>> But if you're looking for a book that will keep you interested in programming, go with my suggestion.Code:std::vector<int> dynamic_array(count);
Perhaps. I can't speak to that part (it's pretty subjective anyway). However, I would rather learn proper habits from a more boring book if I was really interested in the language in the first place.
Not at all. I never said the book was the only suggestion, it's just one of many. There's no reason to think they can't learn to use <cstring> instead...
I honestly can't say I wish I had learned PERFECT coding habits up-front, I would have been bored to tears. I first got into programming for game development (like many members here), and now I learn systems in college.
If I had to worry about the overhead of the most trivial programs, or if I only had the core C/C++ language when I was first learning, I probably would've given up.
And what's so wrong with C-Style strings? In OS development, C is much more commonly used, and therefore a lot of the syntactic sugars of C++ are non-existent. A real programmer needs to know how to adapt to a situation with whatever tools are given to them.
What if PCG33K has to rebuild parts of *nix server from source? Guess what? I can almost guarantee C++ strings won't be an option, and for that matter <vector>
If you want to program in C, then learn C.
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:
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:Quote:
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.
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.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;
};
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.
No, it's not. The class may be rather useless, but it isn't poorly designed.Quote:
Is this a *brain-dead* design as you put it? Almost certainly.
As for C-style strings, yes, you should learn them, but only after you've got a good seating in the easier parts of the language.
You're a gent CornedBee, if I can rightly assume you're infact a *him*!
You can.
All right, I've been rather rude to you in a few recent posts. I'm sorry about that. I see you have a sense of humour after all.