summaryrefslogtreecommitdiff
path: root/miniany/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniany/cc.c')
-rw-r--r--miniany/cc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/miniany/cc.c b/miniany/cc.c
index df89ff7..1637627 100644
--- a/miniany/cc.c
+++ b/miniany/cc.c
@@ -13,7 +13,6 @@ int getChar( )
if( c == '\n' ) {
col = 1;
row++;
- putchar( '$' );
}
return c;
}
@@ -25,11 +24,21 @@ int main( int argc, char **argv )
col = 1;
row = 1;
- puts( "Hello CC" );
+ putstring( "Hello CC" );
+ putnl( );
c = getChar( );
+ putint( row );
+ putstring( ": " );
while( c != EOF ) {
- putchar( c );
+ if( c == '\n' ) {
+ putchar( '$' );
+ putchar( c );
+ putint( row );
+ putstring( ": " );
+ } else {
+ putchar( c );
+ }
c = getChar( );
}