Name: Anonymous 2016-10-20 4:14
Did you know, that keeping frequently accessed field at the start of a struct/class can greatly boost access time and decrease code size? I got like 1/10 speed up.
Anyone have a collection of C tricks?Yes. I have. In my memory. A lot of stuff like http://perltricks.com/article/the-history-of-the-schwartzian-transform/
void abc(){return 2;}
int(*func)() = abc;
int main(){return func();}
#import <stdio.h>
int main()
{
printf("Hello world\n");
return 0;
}
#import
is a valid GCC preprocessing directive which guarantees that the header file in question will be included at most once per translation unit, even if the header file lacks include guards or a #pragma once
directive.