summaryrefslogtreecommitdiff
path: root/miniany/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniany/cc.c')
-rw-r--r--miniany/cc.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/miniany/cc.c b/miniany/cc.c
new file mode 100644
index 0000000..df89ff7
--- /dev/null
+++ b/miniany/cc.c
@@ -0,0 +1,39 @@
+int col;
+int row;
+
+int getChar( )
+{
+ int c;
+
+ c = getchar( );
+ if( c == EOF ) {
+ return c;
+ }
+ col++;
+ if( c == '\n' ) {
+ col = 1;
+ row++;
+ putchar( '$' );
+ }
+ return c;
+}
+
+int main( int argc, char **argv )
+{
+ int c;
+
+ col = 1;
+ row = 1;
+
+ puts( "Hello CC" );
+
+ c = getChar( );
+ while( c != EOF ) {
+ putchar( c );
+ c = getChar( );
+ }
+
+ exit( EXIT_SUCCESS );
+
+ return EXIT_SUCCESS;
+}