DEV Community

Cover image for using c++ like plain c
james
james

Posted on • Updated on

using c++ like plain c

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.

Top comments (2)

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.