How do you open a file using C++/CLI?

bobuck man 61 Reputation points
2021-10-01T15:05:19.083+00:00

Hello, I was wondering how you can open a text file using C++/CLI. I already created the file variable but I got stuck on how to open it.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,631 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 83,106 Reputation points
    2021-10-01T15:22:25.263+00:00

    I was wondering how you can open a text file using C++/CLI.

    A simple way :

    String^ sText = System::IO::File::ReadAllText("E:\\test.txt");