Speedup C++ code | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Speedup C++ code

Hi, which of this two codes is quicker? #define DO_NOTHING { } void DO_NOTHING() { } hope I will get some answers, S.A.

10th Oct 2020, 6:32 PM
Sebastian Ahlborn
Sebastian Ahlborn - avatar
3 Respuestas
+ 2
Quicker in what way? Do you know what each of those line do? despite of which, { } means an empty block (no instruction to execute). How can you measure the quickness when there is no workload being put on as a test?
10th Oct 2020, 8:23 PM
Ipang
11th Oct 2020, 6:33 PM
Shahil Ahmed
Shahil Ahmed - avatar
- 3
#define DO_NOTHING { } is Faster because compiler will allocate it before execution of main().
11th Oct 2020, 4:21 AM
Aditya rout
Aditya rout - avatar