need both c and c++ output statements to work together in one program.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeneil wilson
    New Member
    • Mar 2011
    • 1

    need both c and c++ output statements to work together in one program.

    Code:
    	printf("cout<< Enter Name\n");
    		fflush(stdin);
    		gets(FIRSTPLANE[i].NAME);
    		
    		fflush(stdin);
    		printf("cout<<Enter Address\n");
    		gets(FIRSTPLANE[i].ADDRESS);
    		
    		fflush(stdin);
    		printf("cout<<Enter Phone Number");
    		gets(FIRSTPLANE[i].PHONE);
    		
    		FIRSTPLANE[i].SEATNUM=i+1;
    
    
    
    void MENU()
    {
    	cout<<" please enter 1 for Smoking First Class\n ";
    	cout<<" please enter 2 for Non-Smoking First Class\n ";
    	cout<<" please enter 3 for Smoking Economy Class\n ";
    	cout<<" please enter 4 for non-Smoking Economy Class\n ";
    	cout<<" please enter 5 to exit\n"; 
    }    
    //both header files are inserted
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    if you compile with a c++ compiler you can use printf and cout in the same program as long as you include the right headers and use them in a sane fashion.

    You simply can't do it at all if you want to compile with a c compiler though

    Comment

    Working...