Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a code in c++ which has all coding like in c e.g. printf/scanf. But it also has library of fstream.h . How to change such codes to C programming?

What I have tried:

I have tried removing fstream.h library but received n number of errors.
Posted
Updated 20-Sep-17 7:08am

Rewrite it to use C library functions instead of C++.
 
Share this answer
 
Quote:
But it also has library of fstream.h . How to change such codes to C programming
You have to use fprintf, fwrite, fread instead of corresponding fstream methods and operators (see fstream - C++ Reference[^] ). Since the code contains C-like function for console I/O, probably there is no much use of insertion and extraction operators and your task is relatively simple.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900