G
Guest
Hi,
I have a question. I created a simple executable program using Visual C++
from Visual Studio 6.0
This program is called from a script that passes in one argument.
Now, my question is:
1. When I use int main(int argc, char* argv[]) declaration, the argv usually
contains the data and some garbage at the end.
For example: a script calls this executable and passes in data => this-is-me
When it executes this C++ program, the argv contains => this-is-me@#
Where did the @# come from? and Why?
2. When I use main(int argc, char** argv) declaration, the argv is exactly
what the script passes it.
For example: a script calls this executable and passes in data => this-is-me
When it executes the C++ program, the argv contains exactly => this-is-me
So, what is the difference between these two declarations? Why does the
first one contains garbage characters?
Please help me to understand. I am fairly new at Visual C++.
Many Thanks
I have a question. I created a simple executable program using Visual C++
from Visual Studio 6.0
This program is called from a script that passes in one argument.
Now, my question is:
1. When I use int main(int argc, char* argv[]) declaration, the argv usually
contains the data and some garbage at the end.
For example: a script calls this executable and passes in data => this-is-me
When it executes this C++ program, the argv contains => this-is-me@#
Where did the @# come from? and Why?
2. When I use main(int argc, char** argv) declaration, the argv is exactly
what the script passes it.
For example: a script calls this executable and passes in data => this-is-me
When it executes the C++ program, the argv contains exactly => this-is-me
So, what is the difference between these two declarations? Why does the
first one contains garbage characters?
Please help me to understand. I am fairly new at Visual C++.
Many Thanks