简体   繁体   中英

How can I access methods/functions from another file in this way?

I am new to C++, so I would like to store a file with some methods inside that does some calculations and then I would like to call them like this, FileName.MethodName(Arguments). Is it possible to use the (.) DOT?

I am using C++ in Visual Studio .

You're thinking the wrong way. You don't want to call member functions on a file. You should use a class that wraps around the file stream which has member functions to perform the correct operations on it. Maybe if you can tell us what you're trying to do, I can better suit my answer to your intentions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM