source: doc/theses/mike_brooks_MMath/programs/bkgd-c-tyerr.c @ 719fdbc

Last change on this file since 719fdbc was df699e0, checked in by Peter A. Buhr <pabuhr@…>, 6 months ago

program updates to match text

  • Property mode set to 100644
File size: 514 bytes
RevLine 
[7972603]1#include <stdio.h>
2#include <assert.h>
3#include <stdlib.h>
4
5#ifdef ERRS
6#define ERR(...) __VA_ARGS__
7#else
8#define ERR(...)
9#endif
10
11int main() {
[266732e]12        float * x;                      $\C{// x points at a floating-point number}$
13        void (*y)(void);        $\C{// y points at a function}$
14        @x = y;@                        $\C{// wrong}$
15        @y = x;@                        $\C{// wrong}$
16
17        float pi = 3.14;
18        void f( void (*g)(void) ) { g(); }
19        @f( &pi );@                     $\C{// wrong}$
[7972603]20}
[266732e]21
22// Local Variables: //
[df699e0]23// compile-command: "sed -f sedcmd bkgd-c-tyerr.c | gcc-11 -Wall -Wextra -x c -" //
[266732e]24// End: //
Note: See TracBrowser for help on using the repository browser.