Actually, I dont know on what to begin C or C++. |
My recommendation is to learn C++.
My personal feeling is, that it is quicker for beginners to grasp and apply the concepts of good C++ than of good C. Be aware though, that there are also a LOT more concepts in C++. You will need a very long time until you really feel comfortable thinking in C++ - compared to C. (And since C++ is so huge compared to C, the phrase "thinking in C++" is rather empty anyway).
When it comes to performance, I don't think there is a real difference anyway (especially when you come from Basic *g*).
For your current example, the "way in C++" is using abstraction types for the different elements. You use "string" which comes with his own functions to handle strings instead of raw character memory plus utility functions.
You use streams (cout and cin) to handle input and output streaming which also come with their own functions (e.g. cout << stuff) instead of using plain memory handles that you pass around utility functions (C-ish style).
And you don't structure a function into parts "initialize all variables, calculate stuff using variables, return the result" as it is common in C or Pascal (and QBasic?) but the difference between variable initialization and calulation starts to blur (you use a lot of temporary variables and pass results of functions directly to other functions or return them directly). Most visible is this by the fact that usually in C++ you don't declare a variable until it's really used.
To learn C++, I recommend Stroustrup, "The C++ Programming Language". It's precise and it is a very good reference to have around you. And since you already know a lot of the basic concepts (loops, variables, functions etc) you don't need a day-nanny book, right? ;-)
Ciao, Imi.