How can i uninclude a header int C++

Daniel Shepherd 246 Reputation points
2021-07-12T14:32:35.96+00:00

So, obviously, there is a #include function in c/c++, but I want to UNinclude a header. Does anyone know how?

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,537 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sam of Simple Samples 5,516 Reputation points
    2021-07-12T15:31:01.107+00:00

    Based on your comment you probably want to use the Process Class. I assume you want to write something to a different program. You will need to set the ProcessStartInfo.RedirectStandardInput Property to true. Look at the sample code in the documentation. Also if you need to also get output from the other program then see How to redirect Standard Input/Output of an application - CodeProject.

    0 comments No comments

  2. rupesh shukla 16 Reputation points
    2021-07-14T20:36:42.81+00:00

    As other has already mentioned that you can use preprocessor directory to control your include file . But I am still not sure if I get your question. What are you trying to accomplish here. Because you can have hook in your other application and you can trap mouse click event and based on your click your preprocessor can act the way you want .

    But In your question I still didn't get "once you click the mouse in the win32 app project in the solution, it outputs something in another console app project" then where this include def/undef is coming in picture.

    Thanks

    0 comments No comments