Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Found something cool in C11

Name: Anonymous 2014-08-06 10:58

c.h
typedef int i;
extern int shi;


c.c
#include "c.h"
#include "c.h"
#include "c.h"

int shi;

int
main (void)
{
return 0;
}


As you can see C11 allows multiple typedefs of the same type to the same type, a typedef long i; would be illegal
This avoids the need for include guards but sadly it does not work for structs, not that this is a problem

Name: Anonymous 2017-01-06 17:16

>>28
Its a standard for every decent compiler. If a compiler doesn't have it, why you would trust it with your code? If a closed source/proprietary junk doesn't have #pragma once,its compiler company problem. Guess they could of paid programmers more, instead of selling junk electronics with crippled compilers.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List