diff --git a/Data File handling/Opening_Closing.cpp b/Data File handling/Opening_Closing.cpp new file mode 100644 index 0000000..9fed295 --- /dev/null +++ b/Data File handling/Opening_Closing.cpp @@ -0,0 +1,13 @@ +/*#include +#include +#include*/ +#include +#include +using namespace std; +int main (){ + fstream xyz; + xyz.open("abc",ios::out); + cout<<"created xyz named file"; + xyz.close(); + return 0; +} \ No newline at end of file diff --git a/Data File handling/Opening_Closing.exe b/Data File handling/Opening_Closing.exe new file mode 100644 index 0000000..f07ea99 Binary files /dev/null and b/Data File handling/Opening_Closing.exe differ diff --git a/Data File handling/README.md b/Data File handling/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Data File handling/README.md @@ -0,0 +1 @@ + diff --git a/Data File handling/Reading.cpp b/Data File handling/Reading.cpp new file mode 100644 index 0000000..0f10614 --- /dev/null +++ b/Data File handling/Reading.cpp @@ -0,0 +1,23 @@ + #include +#include +using namespace std; +int main(){ + system("cls"); + fstream xyz; + xyz.open("apple.txt",ios::in); + if(!xyz){ + cout<<"not exist"; + } + else{ + char a; + while (1) + { + xyz>>a; + if(xyz.eof()) + break; + cout< +#include +using namespace std; +int main(){ + fstream sai; + sai.open("abc.txt",ios::out); + if(!sai){ + cout<<"not created"; + } + else{ + cout<<"created success"; + sai<<" \n \n \n \t sadsssjiwnc"; + sai.close(); + } + return 0; +} \ No newline at end of file diff --git a/Data File handling/Writing.exe b/Data File handling/Writing.exe new file mode 100644 index 0000000..628ecc3 Binary files /dev/null and b/Data File handling/Writing.exe differ diff --git a/Data File handling/abc.txt b/Data File handling/abc.txt new file mode 100644 index 0000000..f117210 --- /dev/null +++ b/Data File handling/abc.txt @@ -0,0 +1,4 @@ + + + + sadsssjiwnc \ No newline at end of file diff --git a/Data File handling/apple.txt b/Data File handling/apple.txt new file mode 100644 index 0000000..bde6133 --- /dev/null +++ b/Data File handling/apple.txt @@ -0,0 +1 @@ +hello this is dell 3501eurue \ No newline at end of file