C++ The programme below is is C language. Please convert it to C++ language   else if(strcmp("save", input)==0)                     {                          //if input is save                         cout<<"\nYour words have been saved! ";                         FILE* filePointer;                         filePointer=fopen("output.txt","w");                         save_words(filePointer,stack1,words);                         fclose(filePointer);                         }                                                  else if(strcmp("quit",input)==0) //if input is quit                         {                             FILE* filePointer;                             filePointer=fopen("output.txt","w");                             save_words(filePointer,stack1,words);                             fclose(filePointer);                             cout<<"\nThank you, see you again!";                             exit(0);                             }

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
100%

C++

The programme below is is C language. Please convert it to C++ language

 

else if(strcmp("save", input)==0)
                    { 
                        //if input is save
                        cout<<"\nYour words have been saved! ";
                        FILE* filePointer;
                        filePointer=fopen("output.txt","w");
                        save_words(filePointer,stack1,words);
                        fclose(filePointer);
                        }
                        
                        else if(strcmp("quit",input)==0) //if input is quit
                        {
                            FILE* filePointer;
                            filePointer=fopen("output.txt","w");
                            save_words(filePointer,stack1,words);
                            fclose(filePointer);
                            cout<<"\nThank you, see you again!";
                            exit(0);
                            }
                            

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage