Hi @junior94, I know that you are pretty familiar with Java, I’ve been watching you since I have joined Codechef and you were an active member in discussions and contests.
Well, still since you will only be needing the precise materials in these languages C and C++, I would recommend to pick them one by one.
Now regarding tutorials and books, in C I thought I know very much of C to use in daily practice until I came to read this book, The C Programming Language by Dennis Ritchie, it is not very expensive and a very useful manual for C; I must say it is not for beginners, so you will like it.
For C++, I still consider the best reference is by the creator himself, The C++ Programming Language.
You can go through the C book in few days, but it is the C++ where I would like you to spend more time, few months. Here is a healthy lot of information regarding good and bad C++ books, you can refer to it. As there are many similarities in C++ and Java, it will be really easier for you to go pick C++ once, but it is a good language once we go in deeper.
Online tutorials, there are plenty and there is no need to mention all or few of them here.
Although for you, a very basic grasp in the language would include:
- Using basic translation of programs that you write in Java to C++
- Using containers and iterators wisely. Like this problem can be solved with use of sets pretty wisely and in a much compact manner than when you go to actually write algorithm for it. I can provide you that solution if you wish.
- Using the STL algorithm functions e.g. sort(), next_permutation(), reverse(), sort() with a comparator (to name a few), to fetch you results faster than what you would have got after writing the entire code for the same.
Lastly, you know pretty well that the more you practice the more you’ll get casual with the language. So wish you good luck and welcome to the C++ club, where majority of programmers write in any competition.
I am keeping this answer an open edit-able answer so that more experienced programmers can add more points that I might have missed or that I am yet to learn