Thread: Help needed with a simple programm!!

  1. #16
    Registered User
    Join Date
    Nov 2004
    Posts
    3
    thanks a lot people.it worked.

  2. #17
    Registered User
    Join Date
    Jun 2004
    Posts
    722
    Quote Originally Posted by PING
    if u say frm the standard that it is undefined.bt well,its not that it works only for me.its a tried and tested thing.
    Code:
    #include <stdio.h>
    
    #ifdef PING_s_COMPILER
        typedef void MAIN_t;
    #else
        typedef int MAIN_t;
    #endif
    
    MAIN_t main(){
        /*read some input*/
    #ifdef PING_s_COMPILER
        fflush(stdin);
    #else
        char c;//I know C99
        do{
            c=getchar();
        }while( c!= '\n' && c!= EOF);
        return 0;
    #endif
    }
    Now everyone's happy!
    Last edited by xErath; 11-21-2004 at 09:10 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Socialising Chat Bots
    By bengreenwood in forum C++ Programming
    Replies: 10
    Last Post: 11-28-2007, 08:42 AM
  2. simple 2d "putpixel" api for windows?
    By spiky in forum C Programming
    Replies: 2
    Last Post: 10-27-2005, 02:44 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Tic Tac Toe Simple Game Needed!
    By Ruski in forum C++ Programming
    Replies: 13
    Last Post: 06-28-2002, 07:18 AM
  5. Simple Compile Time Problem - HELP!
    By kamikazeecows in forum Windows Programming
    Replies: 2
    Last Post: 12-02-2001, 01:30 PM