best way to read and modify files (c++) [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
is it better to modify the file using positioning (seekg/seekp ) while it's in the hard drive
with out loading it to the RAM (into an object)
or read it as a whole into an object then treat the object (delete,modify,add...)
better "mostly speed"

The answer depends on your usecase. For one thing there are cases where you can not fit the whole file in the RAM(if it is huge). Also if you only need to perform a small change, loading the whole file will be a huge overhead.
On the other hand if you need to read/modify a huge portion of the file multiple times and it is reasonably big, loading it into the RAM will make sense and will improve the performance.

Related

Statistics from C++ source code [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Do you know any type of tool, possibly for Linux and open source, that can be used to extract statistics from C/C++ source code files.
Apart from the number of lines, I would be interested in:
number of comment lines
number of classes used
number of declarations
and so on.
I use CLOC (http://cloc.sourceforge.net/) for counting lines of code, blank lines and comments. However CLOC does not interpret the code and thus cannot count classes, declarations etc.
And one should probably mention that this kind of statistics is considered meaningless by most people...

way to get data without metadata(ID3) from mp3 [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there any way to get data removed metadata(for example, ID3) from mp3 file with Objective-C, C++, or C?
there are similar function in PHP.
Unfortunately not. Use a library (For ID3, there are library implementations listed on ID3.org).
If for some reason you cannot use a library, removing a single ID3 tag from a file is quite a trivial process (search for the characters 'ID3' and then look at the header to get the tag size in bytes (details of the header found here). The tag will be contiguous so you can just remove it using a file descriptor.

embed .exe with ordinary file [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How could I embed or associate an .exe into an ordinary file, like .jpeg or any video etc.
? I want to associate the opening of the ordinary file with the execution of an executable program.
What you're trying to do is intended not to be possible. If and when it does happen, it takes place by exploiting a flaw in the program reading the file. This might take place (this is more common when the program is written in C or C++) by storing out-of-range values in the headers and hoping the program does not validate them before using them as offsets in memory, or (this is more common in higher-level languages) by taking advantage of a logical error in some overgrown feature the format intentionally allows (like embedding javascript).
Beyond this, I think any further answer is off-topic on SO. This is not a site for getting help writing malware.

For an intermediate programmer, how hard would it be to modify Google Chrome OS and how would one go about it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I think Chrome OS is based on Linux and written in C/C++. I haven't looked at the source but presumably it wouldn't be too hard to change some of the images and UI etc., but if I wanted to, for example, make it log into a proprietary account instead of Google's accounts on login, how hard would it be?
How about pulling down the source first and trying to build/install it yourself? If you feel that it's way overwhelming, then nobody can say it's easy for you.
It's hard to answer "how hard" because there's not an exact standard about "how intermediate" or "how fast can you learn".

*unusual* approach to memory saving? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I was reading in a textbook on c++ about IOstreams, and I came across this:
Whenever you want to store information
on the computer for longer than the
running time of a program, the usual
approach is to collect the data into a
logically cohesive whole and store it
on a permanent storage medium as a
file.
(Quoted from Programming Abstractions in C++)
Is there an UNUSUAL approach to storing data?
Pushing across to a server, operating systems (experimental) that let you freeze parts of RAM etc.
This is a very vague question, and really, has no good answer.
i guess if you store it at some place in the RAM, and hope for it to be there when you run your program again, that would be an unusual way of storing :-)