Ignore:
Timestamp:
Jan 8, 2016, 10:37:10 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
61f9356
Parents:
1cced28
Message:

fix recursive include bug in shadow includes, major clean of examples, add several long long routines to prelude

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/twice.c

    r1cced28 r784deab  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 27 18:37:23 2015
    13 // Update Count     : 1
     12// Last Modified On : Mon Jan  4 11:32:04 2016
     13// Update Count     : 10
    1414//
    1515
     
    2121}
    2222
    23 int main() {
     23int main( void ) {
     24        // char does not have addition
     25        char ?+?( char op1, char op2 ) { return (int)op1 + op2; } // cast forces integer addition or recursion
     26        char ++?( char *op ) { *op += 1; return *op; }
     27        char ?++( char *op ) { char temp = *op; *op += 1; return temp; }
     28
    2429        ofstream *sout = ofstream_stdout();
    25         sout << twice( 1 ) << ' ' << twice( 3.2 ) << '\n';
     30        sout | twice( 'a' ) | ' ' | twice( 1 ) | ' ' | twice( 3.2 ) | endl;
    2631}
    2732
    2833// Local Variables: //
    2934// tab-width: 4 //
    30 // compile-command: "cfa twice.c fstream.o iostream.o" //
     35// compile-command: "cfa twice.c fstream.o iostream.o iterator.o" //
    3136// End: //
Note: See TracChangeset for help on using the changeset viewer.