It is showing the drive number and the linker path.
please explain me how the variables are getting initialized by itself.
Any other combination of the arguments sets garbage values.why?
Every program is run in a shell; basically, by the OS typing in:
programme_path_and_file
and then a whole bunch of extra words. Each extra word is called an "argument". There could be zero extra words. Could be lots.
int a: How many words (string) there were. The first one is programme_path_and_file so there's always at least one.
char *v[] All the words, as char arrays, in an array.
If you ran this programme at the command line: beans -bananas -eggs 4
then a would be 4, and you would find each of those words in the array of char pointers.
> but they are still taught in schools!
And now you know.
And what you might guess is that no-one will pay for those fossil skills, except perhaps "curator of software" at a museum.
I would say bug your teacher about it, but they probably live in a world where no-one gets sacked for sticking to the script, no matter how obviously dumb that script has become.
in windows, the command line args are still important because they can be used to accept drag and drops, like file names, so even a simple GUI driven program may use them. Unix is still largely command line driven and you use these all the time.
g++ is a good compiler to use some to get a feel for a tool that is used everywhere and on both windows and unix. Visual studio IDE from 2019 is the way to go for a nice clean interface and powerful tool. I use the Cygwin version as it also gives me the unix command line tools. Ironically, if you use g++, you will need command line arguments to it :)
Turbo c++ is now 30 years old. C++ language changed in major ways in 1998, 2011, and again in 2017, and again next year. These were radical changes so much so that the difference in how code is written is almost like 2 different languages if you compare code from today with code from before 1998. Windows and hardware changed from dos 16 bit programs to 32 bit programs to 64 bit programs in that same timeframe. 16 bit program no longer work on anything current other than a virtual machine for dos. Turbo builds 16 bit programs... (technically 32 bit cpus came out way before 32 bit os were adopted fully, for historical reasons, but it no longer matters).
Those of us sitting in so-called first world countries can be all high about using the latest and greatest.
But the latest versions of compilers can’t even be frobbed to interface with 16-bit code any more.
While those sitting in India using a 386 for school projects don’t have the power just to run the modern compilers.
If your school requires you to use Turbo C++, then use it. Just be aware that you are studying an antiquated version of the language. Spend some time on your own with modern stuff. India is, sadly, about ten years behind the state of the art anyway. Of course, mainframes running COBOL are still handling tax returns in the USA, so, no need to throw stones.
Learning to program knows no language. If you learn using pre-98 C++, you will find it easy enough to move into modern C++17 (and be pleased by the improvements). But you will also be uniquely qualified to look at that old code and fix it in your job.
Except there is no* old code that used Turbo C++ outside of students' homeworks. Back in the early-to-mid 1990s PC it was all Microsoft, Zortech, and Watcom C++.
[*] based on the limited scope of the software I personally encountered as a curious college student.
I had some small company projects in borland builder, but turbo as you said was only used by hobby / students.
I understand the issue but its not elitism. If your only pc is a 386, that is ok, but it can handle a carefully installed stripped down linux with g++ (all free). I do not know what the highest version of 32 bit g++ is, though -- certainly there would be a 32 bit with stl in it. If the school system refuses to do that, it is not a first or third world problem, its a problem with the school system (or government, or some total misunderstanding of what could be done without adding costs).
On the flipside, whatever they are doing apparently works. Half my team at work is from india and their work is excellent (though not c++). Far better than the first world 'copied the web to get thru school' crowd.