Compile time of C versus C++ code
Hello all,
Just joined this forum and its nice to be here.
I am an electrical engineer and do circuit simulations by writing code. So far I have written my code in C. I am thinking of converting the code to C++. I began by writing a C++ code to simulate a simple resistive inductive circuit. I defined a class called matrix and using operator overloading defined all the matrix operations. I used Runge Kutta 4 th order method to solve the ODE performing a transient simulation.
I find that the C++ program runs 3 times slower than the C program. And this is with basic code. Anyone else wish to share a similar experience with me?
Thanks in advance.