Is C++ exactly the same syntax & keywords as C, with addition of OOP features? Or are there differences in syntax & keywords? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is C++ exactly the same syntax & keywords as C, with addition of OOP features? Or are there differences in syntax & keywords?

C++ how similar to C?

10th May 2017, 10:39 PM
Sammi
Sammi - avatar
5 Answers
+ 7
not exactly the same. but very much like as far as I am aware. most c code is valid c++ code. but newbie here sooooo. grain of salt?
10th May 2017, 10:48 PM
jay
jay - avatar
+ 5
despite C++ being derived from C, they both differ @Jay, most C++ compilers support C so you can use C syntax within the C++ program. it all depends on the various header files that you use.
10th May 2017, 11:29 PM
Krishneel Nair
Krishneel Nair - avatar
+ 4
They work in a similar way. for C printf("hello world"); for C++ cout<<"hello world"; The keywords may be different, but C++ is defived from C.
10th May 2017, 10:56 PM
Manual
Manual - avatar
+ 4
@krishneel; thought so. thanks mate
10th May 2017, 11:30 PM
jay
jay - avatar
+ 2
quick comparison https://drive.google.com/file/d/0B66ub-Li9jOQQnRqb1h5ZDFCRUU/view?usp=drivesdk I would like to add they can both be used at the same time
11th May 2017, 10:33 PM
DeleteThisAccount