Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   How to master C++ ? (http://www.go4expert.com/forums/master-cpp-t22332/)

CrazyGeek 6Jun2010 20:36

How to master C++ ?
Hi everybody!
I'm new to C++. I have a little skill with Visual Basic, but I really don't know how to master C++. I have some troubles, can anyone help me plz?
1. I suppose that to master C++, I must to learn basic syntaxes, structrure of a program, members of a program such as classes, variables and functions of all data types, and the last standard C++ library. Is all of that enough?
2. Can anyone tell me the differences between basic C++ and advanced C++ ?
3. When I refer some functions in standard library to use, I emphasize the words "to use", there's no problem to me, I can easily understand and call them successfully in my programs, but when I refer the prototype code of them, I understand nothing why they become so complicates. Such as the function ( member function) width in the class ios_base, its prototype is:
streamsize width(streamsize wide);
However, when using this member function with the object cout, I only need to call
cout.width(a positive value of integer type);
For example: cout.width(30);
Obvisously, my understanding of this function is simpler than its prototype and surely never goes wrong. So what's better when I refer its prototype ?
Plz help me go through out this problem, I bought a 6$ book of Standard C++ Library, but I can't find ease to learn C++ with it. Thank all !!!

shabbir 6Jun2010 20:57

Re: How to master C++ ?
Do not create the same thread more than once and I have removed your other thread.

Mike911 7Jun2010 10:51

Re: How to master C++ ?
2. What should be advanced C++? Are YOU advanced ?
3. What a nice prototype of a function.

xpi0t0s 7Jun2010 13:08

Re: How to master C++ ?
A book on the Standard C++ Library won't help you at all at this stage. You need a book that teaches you how to program in C++.

Why do you want to master C++? Are you sure you wouldn't be better off sticking with what you know, i.e. Visual Basic? This will do 99% of what you can do in C++ and just as well in most cases, especially if you're using a recent version of VB.Net.

To master C++ you will need to understand all elements of the language. After the C++ primer, get yourself a copy of Stroustrup's latest edition and read it cover to cover.

You will also need to write some programs. For ideas, look up sites like osix.net and others with challenges that need programs to be written to solve them. Also look at sites like this one and when someone posts a homework problem try to solve it (but DO NOT post your reply - this will not help them). For ideas beyond that level, there are plenty of open source programs that are in need of programmers.

Can't tell you the differences between basic C++ and advanced. Same as basic and advanced anything I suppose. What are the differences between basic and advanced Visual Basic?

Understanding prototypes is not necessary at your level. As your skills improve you will start to understand what they mean. The particular example you've chosen works because there is a conversion available that converts an int to a streamsize, possibly a constructor of some kind. If you haven't got a clue what that means, get yourself a primer and work through that, then work through the Stroustrup.

CrazyGeek 8Jun2010 20:57

Re: How to master C++ ?
I think I know how to program in C++ at medium level , such as I know the importance of defined functions in linked libraries including Standard C++ library. I know a certain knowledge of classes, templates, inheritence, namespace, polymorphism, constructor, destructor, operator overloading, pointers,...In conclusion, I know a certain knowledge of the new definition "class" and concerned understanding in OOP generally and in C++ particularly.
At my level, I feel the need of understanding standard c++ libraries, What do I have to do when assigning a string variable to other without using strcpy() defined in the header file string.h ? I have to do it by myself. So a knowledge of Standard C++ Library is necessary to me.

My troubles here is I don't understand class and function prototypes although the practice of calling functions is not complicates as their prototype.
For example, I can use the function cout.width(...) well because I refered it in a C++ programming book not in the Standard C++ Library book, I think I would never understand how to use the function cout.width(...) if I refer its prototype at the first time.

I have only a little skill of programming with Visual Basic, but I suppose that one of advanced elements in Visual Basic is API programming, using API for programming system, hooking and subclassing. All most of IT students in our universities never knows about these technologies. Because they are only teached at basic level.

I really don't know what Stroustrup is? Can you introduce more about it to me plz ?

I will try learning how to use functions before understanding their prototype.
Thank you for paying attention to my thread. Thank you very much !

xpi0t0s 8Jun2010 21:20

Re: How to master C++ ?
There's no way you can be anything other than a beginner in C++ if (a) you don't know who Stroustrup is, (b) you don't know how to use Google and (c) you don't know how to copy a variable of type string to another. Sorry to bust your bubble but this is really basic stuff, and knowing "a certain amount" of various language features isn't anything like enough. It's like you've just filled in one digit in a Sudoku and declared yourself a world expert on the subject.

A book on the C++ library is useful but you really need to get yourself a book that is aimed at teaching C++. This will cover all the basic stuff you need to know including everything you're asking here.

But keep learning about the language, keep programming with it, take on new challenges; that is how you will learn and how you will pick up new ideas and techniques. Work together with someone on an open source C++ application: find one you're interested in, download the code and start playing with it - add new features, change the way it works, etc.

arif1aziz 9Nov2010 05:47

Re: How to master C++ ?
read "Accelerated C++"

Mike911 11Nov2010 10:22

Re: How to master C++ ?
Yes, now I know -> You are at a expert level in programming.
If you would like to be a scientist, just study 10 years more !

I think your question of prototypes is answered all over the www.
You yust doin´fine, just go ahead and dont be afraid...

Mike 911

All times are GMT +5.5. The time now is 07:26.