M
M
Makaleks2014-05-28 15:09:42
C++ / C#
Makaleks, 2014-05-28 15:09:42

How to get file pointer?

The C language , when working with files, uses a pointer to a file, and libraries written on it do the same.
But C++ uses OOP sort of without this pointer.
Maybe I missed something, and the pointer can be obtained from the object?
As a last resort, if FILE is a structure, is it possible to somehow get / generate this structure from an object?
Do not include 2 libraries for working with files... Although you can return to the C version
. My case is libpng.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur Shellunts, 2014-05-28
@Makaleks

Judging from a similar question , there is no standard way to get FILE*from std::fstrream. But there are hacks, see the link .

A
AxisPod, 2014-05-29
@AxisPod

So what's the problem, the code is still in the standard lib, with which it links anyway. Use both, there is no problem in this, the code is still linked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question