|
Browse by Tags
All Tags » c (RSS)
-
[quote user="alegr"] [quote user="Wolftaur"]As far as I know, no C compiler exists for any one's complement machine.[/quote] IIRC, ANSI C standard requires two's complement machine. [/quote] Specification Lad to the rescue! [quote user="C99, 6.2.6.2(2)"] For signed...
-
[quote user="danixdefcon5"] int [ ] codez = { 0xffb002b4, 0xc93180b2, 0x13cdf630, 0x909090c3 } int main(int argc, char **argv) { codez(); } Guess what this does. [/quote] I know what it doesn't do — compile. Here, FTFY: int main[] = { 0xffb002b4, 0xc93180b2, 0x13cdf630, 0x909090c3 };
-
Wow. I can install Ubuntu in C. Also, C is called "No localization" in C. I wonder if I can get Ubuntu in other programming languages like Fortran, BASIC, Javascript, Perl, Python, and Java.
-
[quote user="joeyadams"] If you want the function to return a pointer to itself rather than a structure containing that pointer, you can do that too: ~SNIP~ [/quote] Well... except it doesn't work. Have you tested it? [quote user="joeyadams"] By the way, how do I disable HTML...
-
The compiler isn't likely to put any padding between the doubles, but I don't think there's something prohibiting it to do it. You can do the following, which is less risky, but potentially less efficient: #define FooArray(foo) { &(foo.x), &(foo.y), &(foo.z) } void IUseFoo(Foo...
-
[quote user="Spikeles"] Because, on some architectures, char is not 1 byte in size. [/quote] That's false. [quote user="C99, 6.5.3.4(3)"] When [sizeof is] applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1...
-
I'm not sure if there's a way to do exactly what you want, but you can enclose the function pointer in a struct and be happy: #include <stdlib.h> #include <stdio.h> struct container { struct container (* call)(int); }; struct container look_I_return_myself(int p) { struct container...
-
I'm a bit late, but I thought I'd try my hand for the warnings program. This program will probably segfault, though it shouldn't surprise anyone -- it does a lot of pointer munging for the heck of it. 50+ warnings, mostly unique, 256 bytes of source, so about one warning every 5 characters...
-
[quote user="morbiuswilters"] Spectre is incorrect, though, it is meant for copying null-terminated strings, that's why it halts on a null in the source string. If your source isn't null-terminated and your size is larger than the source, you get read errors, so it's obviously meant...
-
|
|
|