Skip to content
Advertisement

Creating a new file from a cpp program in Ubuntu [closed]

How do I create a new file from a cpp program in Ubuntu, and is it any different from windows.

Advertisement

Answer

Declare a stream class file and open that text file in writing mode. If the file is not present then it creates a new text file. Then check if the file does not exist or not created then return false otherwise return true.

JavaScript

Source geeksforgeeks : C++ program to create a file

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement