Read/Write String from/to a File in Android

I want to save a file to the internal storage by getting the text inputted from EditText. Then I want the same file to return the inputted text in String form and save it to another String which is to be used later. Here’s the code: package com.omm.easybalancerecharge; import android.app.Activity; import android.content.Context; import android.content.Intent; import … Read more

C fopen vs open

Is there any reason (other than syntactic ones) that you’d want to use FILE *fdopen(int fd, const char *mode); or FILE *fopen(const char *path, const char *mode); instead of int open(const char *pathname, int flags, mode_t mode); when using C in a Linux environment? 11 Answers 11

How to write a large buffer into a binary file in C++, fast?

I’m trying to write huge amounts of data onto my SSD(solid state drive). And by huge amounts I mean 80GB. I browsed the web for solutions, but the best I came up with was this: #include <fstream> const unsigned long long size = 64ULL*1024ULL*1024ULL; unsigned long long a[size]; int main() { std::fstream myfile; myfile = … Read more