×

# C or C++ ?

 0 I have come across many times that many good coders use C instead of C++. Why is so? I myself find C++ better for coding. Should I start coding in C? asked 02 Apr '15, 17:58 3★sharru05 559●1●7●23 accept rate: 14%

 1 Well , one of the reasons for using C over C++ in competitive programming is because of the speed of scanf() over cin. scanf() takes less execution time than cin, and most new users who find out about this advantage use them, and hence, their code's might seem to be more like C , when they are actually C++ programmers ( the advantage of many C functions working on C++ is also to be noted ). Please note that the more established users would use getchar_unlocked() over scanf(). This is one of the main reason for it. I'm saying this because that's what I used to do ( I'm sorry for bringing up my personal experience, but it is one of the main reasons ) . I was originally a C++ programmer, and I programmed in C++. But when I found about the speed advantage of using some C functions over C++, I started using them, and soon, the code would look entirely C. So, since most part of C can be used on C++, it won't harm to learn C as well. But, it's better to have C++ as your main language and use C for certain parts ( like to improve speed, etc ). It's also good to learn C++ because of the large amount of Libraries available in C++. But, the most important thing is to practice. With lots of practice, you can get better in any language ( but remember that no one is perfect and we all make mistakes , so it's nothing to be ashamed of to ask for help ) . So, when you choose to learn a language, make sure to work hard and always try to learn new things. In the world of programming, experience is what will help you get better, and there is no other shortcut than practice. Happy Coding........ answered 02 Apr '15, 19:57 1★arun_as 741●3●6●18 accept rate: 10%
 0 Code in the language you are most comfortable with. C++ is an excellent choice due to its ready implementation of useful libraries, data structures and ready-to-use methods which you will have to write from scratch in C. answered 02 Apr '15, 18:20 32●4 accept rate: 11%
 0 As far as contests, use the latest version of C++ (currently C++14). As the above answer notes there are I/O performance issues to be aware of. Outside of contests, there are many (often low-level) projects in C. answered 02 Apr '15, 22:04 2★merolish 1 accept rate: 0%
 0 C++ provides you stl and object oriented programming. Just see the below link i hope you would continue with c++ only. By the way i have seen many good coders in c++ also!!! As per to your tags see -- http://stackoverflow.com/questions/497786/why-would-anybody-use-c-over-c answered 03 Apr '15, 01:17 116●4 accept rate: 14%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,911
×1,477
×31

question asked: 02 Apr '15, 17:58

question was seen: 1,334 times

last updated: 03 Apr '15, 01:28