Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Should I move in c++ or finished c programming deeply?

+16 votes
asked Jul 19, 2021 by ismail andrey (470 points)
I covered basic c programming . Now what I should ? Finish deep (data structure and algorithm) in c or move in c++ ?

Thanks in advance.

4 Answers

+4 votes
answered Jul 19, 2021 by Peter Minarik (89,040 points)
selected Jul 19, 2021 by ismail andrey
Best answer
In C++, you can use C code.

I would suggest first maybe learn more about data structures and algorithms just in C.

When it all goes well, then you can open the door to C++ (classes, references and a whole new set of libraries).

Otherwise, there would be an overwhelming amount of information which only would form a shallow knowledge that you couldn't use when you need it.

Practice makes perfect. ;)

Good luck!
commented Jul 19, 2021 by ismail andrey (470 points)
Thank you ! Could you suggest me some books for beginner ?
commented Jul 20, 2021 by Peter Minarik (89,040 points)
edited Jul 21, 2021 by Peter Minarik
A classic book is https://www.amazon.com.au/Programming-Language-Brian-W-Kernighan/dp/0131103628

The co-author (Dennis Ritchie) is the one who created the C language. :)

But this focuses mostly on the C language itself. I never read it though, but we were suggested this book at university and you can see it's very highly rated.

I personally prefer (online) tutorials or problems straight away.

For instance, someone posted these problems:
1. http://question.onlinegdb.com/10435/how-to-program-in-c-language-structured-data
2. http://question.onlinegdb.com/10436/programming-in-c-data-structure-card-game

I think they are relatively easy. I also suggested a solution (logic, not the actual code) for them.

You can look around and solve problems on this site, or find other sites. Up to you.

It can also be useful to look at existing solutions for existing problems. For instance I provided some answer for this problem (regarding data structures: arrays and structures): http://question.onlinegdb.com/10453/i-need-to-include-names-of-countries

Some resources I often use is the C/C++ reference that has the list of C (and C++) libraries, functions, etc: https://www.cplusplus.com/reference/clibrary/

You can find various tutorials, e.g. https://www.tutorialspoint.com/cprogramming/index.htm.

You can also post your own problem on this site and provide your solution. Members will be happy to have a second look and provide opinions, suggestions, fixes. (I would definitely be happy to look at your code.)

If you're an absolute beginner, you can do maybe first some simple, well known mathematical problems.

E.g. Ask the user to provide a number. Print every number between 0 and this number. Then you can spice it up, e.g. print only the odd numbers. Or print only the primes. Or only the palindromes (google what a palindrome is, in short: it reads forward and backwards the same, e.g. 22 or 141 or 1111).

So dig in, start learning, start solving problems. Actually doing programming is way more effective than just reading about them.

Good luck! :)
commented Jul 21, 2021 by ismail andrey (470 points)
-Thank you so much!
0 votes
answered Jul 19, 2021 by B18EC127 Sriram reddy (140 points)
I would suggest you to complete DSA in C first, then switching from C to C++ is just a matter of syntax changes
0 votes
answered Jul 30, 2021 by Alex (220 points)
i would suggest c++
0 votes
answered Aug 12, 2021 by GAURAV MISHRA (140 points)
start c++.no need to learn c.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.