DEV Community

Cover image for using c++ like plain c

using c++ like plain c

james on October 14, 2021

its a bubble sort (sorting algorithm), i was trying to make it look more readable for beginners. Without any function and any class just simple as c.

Collapse
 
tiagomelojuca profile image
Tiago Melo Jucá

You can write your c++ code almost exactly like a plain c code. Just look up for the c*.h headers, like cstdio instead of stdio.h. But if it's your intention, why not just write in C? C++ can link against C code too.

Collapse
 
prathamesh_holay profile image
james

Yeah it can.Just messing with the syntax.