How to Read C Declarations

by Joey deVilla on February 6, 2008

Here’s a handy guide to reading C declarations, where things can get very confusing very quickly. Quick — what’s being declared in the line “int (*(*vtable)[])();” ?

{ 1 trackback }

nothing happens :: meh, meme game, what the hell.
February 15, 2008 at 8:10 pm

{ 2 comments… read them below or add one }

1 Ryan Waddell February 6, 2008 at 2:21 pm

Ya know what that declaration says to me? “Thank god you don’t program in C anymore” :)

2 Nicholas Carey April 14, 2008 at 4:50 pm

I haven’t programmed seriously in C/C++ for a decade or more…but it’s still simple: “vtable” is a pointer locating an array of pointers to functions returning int.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: Your First Warning: DemoCamp 17 Takes Place on Monday, February 25th

Next post: Adding Type Checking in Ruby