Presumedly the code uses a few basic file-I/O function calls and no C++ specific language elements. No good example to learn about C++.learn about the nuances (compared to C).
1. What's the C++ function that does that ?2. create "new_file.bin" in append mode.
1. What's the C++ function that does that ?
2. What are the other modes that a file can be opened in ?
I found too many examples that supposedly do the same thing in many different ways
...Hope your conscience is clear srizbf...
FILE *fin, *fout;
fin= fopen("some_file.bin");
fout = fopen("some_file_2.bin");
int skip = 4, c, idx;
for (idx = 1; c = (getc(fin)) != EOF; ++idx)
{
if (idx % skip == 0)
{
putc(fout );
}
}
fclose(fin);
fclose(fout);
#include <iostream>
#include <fstream>
using namespace std ;
int main ( )
{
ofstream some_file ("some_file.bin", ios::out | ios::app | ios::binary);
some_file << 0x01 ;
some_file.close( );
return 0;
}
Can you help with #12 ?
Why ?I suspect you actually created a single byte file with 0x01 in it rather than appending
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?