Which way is faster ?

I have no idea which way is fastest.... :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
bool bA = false, bB = false, bC = false;
bool bA = false, bB = bA, bC = bA;
bool bA, bB, bC;bA = bB = bC = false;

int nA = 100, nB = 100, nC = 200;
int nA = 100, nB = nA, nC = nA + nB;
int nA, nB, nC;nA = nB = 100;nC = 200;
int nA, nB, nC;nA = 100;nB = 100;nC = 2 * nA;

fA = 0;fB = 0;fC = 0;fD = 0;fE = 0;fF = 0;
fA = fB = fC = fD = fE = fF = 0;

const char *string = "Hello World!";
unsigned int len = strlen(string);

const char *string = "Hello World!";
auto p = string;while(*p++)++len;

const char *string = "Hello World!";
const char *p = string;while(*p++)++len;
Topic archived. No new replies allowed.