4 ms·
Here's a bunch of examples: http://www.geeksforgeeks.org/write-c-program-wont-compiler-c/ http://www.geeksforgeeks.org/write-c-program-wont-compiler-c...
by astrodust 10y ago
Here's a bunch of examples: http://www.geeksforgeeks.org/write-c-program-wont-compiler-c/ http://www.geeksforgeeks.org/write-c-program-wont-compiler-c...
- Chromozon 10y agoThis is a great example of how many of the things in C that don't compile in C++ are horrible programming practices, and it's really nice that C++ doesn't allow such garbage.
- magnusjonsson 10y agoActually those are very bad examples. In practice, compilers will produce warnings in all of those examples. Better examples (of actually useful things) would be things like designated initializers, struct literals, declaring array lengths in args using static, etc.
- milesrout 10y agoI don't see what is 'horrible programming practice' about int *x = malloc(sizeof(int));