struct and class problem!

 
class test:CObject
  {
   int a;
   int b;
   int c;
   string d;
  }

struct test
  {
   int a;
   int b;
   int c;
   string d;
  }

In simple develop,struct use less memory and run faster than class,IS THAT RIGHT?

Documentation on MQL5: Standard Library / Basic Class CObject
Documentation on MQL5: Standard Library / Basic Class CObject
  • www.mql5.com
Basic Class CObject - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
ah2005:


In simple develop,struct use less memory and run faster than class,IS THAT RIGHT?

use the code button to post code </>

where are the results of your tests?

most classes would include methods etc so not really comparable. 

 
Paul Anscombe #:

use the code button to post code </>

where are the results of your tests?

most classes would include methods etc so not really comparable. 

I think to many methods must make run slow!

so if i use struct must faster than classes

 
ah2005 #:

I think to many methods must make run slow!

so if i use struct must faster than classes

I am not sure you understand what classes and OOP are all about 

good luck