Simon Mourier's Avatar
Simon Mourier's blog (1807 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI3, AOT, P/Invoke, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • c/c++
  • storage
  • winapi

read the file that is opened with my console application in C++

Jan 16, 2021 See the question and my original answer on StackOverflow

You just need to declare arguments to your main like this:

int main(int argc, char *argv[])
{
   ...
}

And the file path will be passed as one of the argument. If you open multiple files, it will run one process per file.

  • SmoBlog © 2010-2026 Simon Mourier. All rights reserved.
  • Privacy & Terms