What is void in C?

What does void mean in C? I think it’s confusing to think of it having a singular meaning. It is part of a number of unrelated syntactic forms, and should be understood separately in each:

It is confusing to call void a “type”. There are positions where a normal type (int) can be used, but void cannot. For example, int foo; is a valid declaration, but void foo; is not. There are also positions where void can be used, but a normal type cannot. For example, char foo(int) { return 'c'; } is not a valid function definition.

The standard calls void an “incomplete type”, but I find this unenlightening in the case of char bar(void).

I just released Vidrio, a free app for macOS and Windows to make your screen-sharing awesomely holographic. Vidrio shows your webcam video on your screen, just like a mirror. Then you just share or record your screen with Zoom, QuickTime, or any other app. Vidrio makes your presentations effortlessly engaging, showing your gestures, gazes, and expressions. #1 on Product Hunt. Available for macOS and Windows.

With Vidrio

With generic competitor

More by Jim

Tagged . All content copyright James Fisher 2016. This post is not associated with my employer. Found an error? Edit this page.