Calling functions from main() in c++ [duplicate] - c++

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Calling functions from main() in c++
Hello.
I have a programme that has about 100 classes and more than 1000 functions spread over 20 header and source code files. What I want to know is that how I can pass arguments to so many functions in so many files? What is the procedure adopted for this in main()?
Regards,
Supriyo

Take a look at the Boost.Program_options module.

Related

Redefining a #define in c++ on run time [duplicate]

This question already has answers here:
Changing a macro at runtime in C
(5 answers)
Closed 5 years ago.
Right now I'm merging two codes with the same core, but they differentiate with the #defines, what I need is to make a way around it an choose wicth configuration I need on run time, the code uses if ENABLE(defined) to verify the configurations to load, how can I modify the code to make it work?
Thanks
You can't. Macro are pre-processor. They are gone during compilation.
Variables are the best choice.
By the way, this question is answered here.
Changing a macro at runtime in C

Calling a .net function from C++ [duplicate]

This question already has answers here:
How do I call a .NET assembly from C/C++?
(9 answers)
Closed 8 years ago.
I want to use this function to zip up a folder from a C++ console application. No examples are given in the article of how to use the function from C++, just C# or VB, and I can't find any other code samples anywhere.
The article doesn't really even clarify whether the function is available in C++. Is this function supported in C++? And if so, how do I call it?
Thanks.
This doesn't answer your specific question of calling that .NET method you requested, but, if you want to compress some files using native C++, look at using Zlib and there is a contribution app called minizip which you can use for opening / creating zip archives.

C++ equivalent for print_r() from PHP? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Dump facility in C++ like var_dump() in PHP?
I'm not sure does C++ even allow this kind of thing, but I was wondering, could it be possible to write a generic function that could output any type array (std::vector) as plain text, as long as I write myself each of the types output function, for example std::string, float, int, etc.
So, how could I go through the structs types and output them one by one by different output functions made by me?
You should have a look at cxx-prettyprint. http://louisdx.github.com/cxx-prettyprint/
I think it does all your asking for.

What are WinMainCRTStartup, tmainCRTStartup, WinMain functions used for? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicates:
“APIENTRY _tWinMain” and “WINAPI WinMain” difference
What functions does _WinMainCRTStartup perform?
I just started to dive into windows programming. And when I tried to understand the win 32 program I noticed that the program has two entry points which are _tmainCRTStartup and _WinMainCRTStartup. Besides, I found the _tmainCRTStartup function also called _WinMain function. I just wonder what are they used for? And why there are two different entry points.
Thanks!

C++ change sort method [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
C++ struct sorting
Is it possible to sort a vector in C++ according to a specified sorting method, like used in Java's Collections.sort that takes a Comparator?
Yes. See the answers to this question from this morning: C++ struct sorting
Yes, it is. Take a look here for an example.