mikeash.com: just this guy, you know?

"A failure in the hot air department"
RSS feed (full text feed) - Show Tag Cloud
Showing entries tagged "c". Full blog index.

by Mike AshTags: fridayqna swift c
In order to work with C APIs, we sometimes need to convert Swift object references to and from raw pointers. Swift's Unmanaged struct is the standard API for handling this. Today, I'd like to talk about what it does and how to use it.

by Mike AshTags: fridayqna valgrind c
Outside of Swift 2 news, one of the exciting announcements to come out of WWDC was that clang's Address Sanitizer is now available directly in Xcode 7. Today I'm going to discuss what it is, how it works, and how to use it, a topic suggested by Konstantin Gonikman.

by Mike AshTags: fridayqna c preprocessor evil
The other day I ran into an interesting problem: how can you write a C preprocessor macro that removes parentheses surrounding its argument, but leaves the argument alone if no parentheses are present? For today's article, I'm going to share my solution.

by Mike AshTags: fridayqna c
Welcome back, and apologies for going silent without warning. Something resembling normality has resumed, and so I hope to also resume something resembling my normal schedule. In any case, for today's article, local reader Michael Manesh suggested that I talk about how you can use (or abuse) C's type system to obtain stronger typing guarantees by creating structs containing only a single field.

by Mike AshTags: fridayqna c quiz
I thought I'd mix things up a bit today and give my readers a quiz. The C language is perhaps the most popular computer language in existence, but it's also quite odd, and because of that often poorly understood. I'd like to give you a quiz to see how much you know about some of the odd but useful corners of the language.

by Mike AshTags: fridayqna letsbuild c objectivec cocoa
Our long effort to rebuild Cocoa piece by piece continues. For today, reader Nate Heagy has suggested building NSString's stringWithFormat: method.

by Mike AshTags: fridayqna c objectivec cocoa assert
Asserts are a powerful tool for building quality code, but they're often poorly understood. Today, I want to discuss the various options for writing asserts in Cocoa apps and the best ways to use them, a topic suggested by reader Ed Wynne.

by Gwynne RaskindTags: c preprocessor evil fridayqna linux guest
It's been a bit since I did an article, but I'm back again, with a somewhat off-the-cuff treatment of a very twisted set of code I use to pretend that C has exceptions. I delve into little-known extensions of C, Linux compatibility, and worst of all, goto, so be warned!

by Mike AshTags: fridayqna objectivec c
The inevitable rotation of the Earth means that it's once again time for another Friday Q&A. For today's edition, Jose Vazquez suggested that I discuss namespaced constants and functions in C.

by Mike AshTags: fridayqna c objectivec
Greetings, salutations, and welcome to another edition of Friday Q&A, the Fridayest source of information on the internet. This week, friend of the blog Jose Vazquez had the idea of discussing miscellaneous compile-time tips and tricks in C/Objective-C, like useful preprocessor techniques and compile-time asserts.

by Mike AshTags: fridayqna c macros
The year is almost over, but there's time for one last Friday Q&A before 2011 comes around. For today's post, fellow Amoeba Dan Wineman suggested that I discuss tricks for writing macros in C.

by Mike AshTags: fridayqna c vararg macro
Welcome to another Friday Q&A, where all references are strong and all values are above average. This week I'm going to talk about how to write macros and functions that take variable arguments in C, as suggested by Damien Sorresso.

by Mike AshTags: fridayqna c
Greetings and welcome back to Friday Q&A. This week I'm going to discuss some tips and tricks for using printf-style format strings in C, as suggested by Kevin Avila.

by Mike AshTags: fridayqna c
Here at last is the conclusion to Friday Q&A's three-part series on C type specifiers. The first week I discussed const and restrict. Last week I discussed the basics of volatile and why it's not very useful. This week I'm going to finish up by discussing the use of volatile in a multithreaded context.

by Mike AshTags: fridayqna c
Welcome to another edition of Friday Q&A. Last week I began to talk about type qualifiers in C, and discussed the meaning and use of the const and restrict qualifiers. This week I will continue with a discussion of the third qualifier, volatile.

by Mike AshTags: fridayqna c
Welcome back to another warm and fuzzy edition of Friday Q&A. This week I'm going to discuss the use of type qualifiers in C, a subject suggested by Nate Vander Wilt.

IOCCC 2006 Winners at 2007-11-04 14:17
by Mike AshTags: ioccc c evil
The winners of the 2006 IOCCC have been posted. Sadly I am not among the winners this year, but the winners all appear to be most deserving.

Hacking C++ From C at 2006-08-03 00:00
by Mike AshTags: magic c c++ hack
For a long time, LiveDictionary used deeply unwholesome methods to do its work. Version 1.2.5, just released, now uses nothing but public methods. This means vastly improved stability, but it also means that LiveDictionary's evil WebKit text grabber, once considered the app's crown jewels, is no longer useful. I'm going to use it as an object lesson on how to do evil things with C++ applications from pure C.

Score! at 2005-11-09 00:00
by Mike AshTags: ioccc evil c lisp
The International Obfuscated C Code Contest is a contest with the goal of creating the most unreadable, difficult-to-understand C program possible. Aside from being difficult to understand, the judges tend to prefer programs which do clever or interesting things, or which do mundane things in clever, interesting, or weird ways.
Hosted at DigitalOcean.