Changes in src/examples/quad.c [86bd7c1f:843054c2]
- File:
-
- 1 edited
-
src/examples/quad.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/quad.c
r86bd7c1f r843054c2 1 //2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo3 //4 // The contents of this file are covered under the licence agreement in the5 // file "LICENCE" distributed with Cforall.6 //7 // quad.c --8 //9 // Author : Richard C. Bilson10 // Created On : Wed May 27 17:56:53 201511 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed May 27 18:26:36 201513 // Update Count : 214 //15 16 1 extern "C" { 17 #include <stdio.h>2 #include <stdio.h> 18 3 } 19 4 20 5 forall( type T | { T ?*?( T, T ); } ) 21 6 T square( T t ) { 22 return t * t;7 return t * t; 23 8 } 24 9 25 10 forall( type U | { U square( U ); } ) 26 11 U quad( U u ) { 27 return square( square( u ) );12 return square( square( u ) ); 28 13 } 29 14 30 15 int main() { 31 int N = 2;32 printf( "result of quad of %d is %d\n", N, quad( N ) );16 int N = 2; 17 printf( "result of quad of %d is %d\n", N, quad( N ) ); 33 18 } 34 19 35 20 // Local Variables: // 36 // tab-width: 4 // 37 // compile-command: "cfa quad.c" // 21 // compile-command: "../../bin/cfa quad.c" // 38 22 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.