Hi,
I am new to Dev C++ environment and I am trying to run some programs in a project created in the latest Dev C++ 5.0 Beta version of the IDE. I am having trouble trying to pass command-line arguments as in standard C program via (argc, argv) . Can't seem to figure out where to write them !! Some enlightenment will be greatly appreciated.
Thanks
Bijit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, as a function:
int myfunc ( in here the arguments are declared. )
{
...body of function....
}
Note: ------------------------------------------------------------------------
int main(int argc, char *argv[])
{
...body of function....
}
Here the [ type + argument-name ] then a comma.
from above int argc, ... the same and so on as many arguments as you need.
These arguments now declared, recevie information passed to the function.
Within the body of the function these arguments can be used as local variables: Assignments can be made to them, and can be used in statements.
Hope this will help...
j@ck_
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am new to Dev C++ environment and I am trying to run some programs in a project created in the latest Dev C++ 5.0 Beta version of the IDE. I am having trouble trying to pass command-line arguments as in standard C program via (argc, argv) . Can't seem to figure out where to write them !! Some enlightenment will be greatly appreciated.
Thanks
Bijit
Remember C++ here...
Ok, as a function:
int myfunc ( in here the arguments are declared. )
{
...body of function....
}
Note: ------------------------------------------------------------------------
int main(int argc, char *argv[])
{
...body of function....
}
Here the [ type + argument-name ] then a comma.
from above int argc, ... the same and so on as many arguments as you need.
These arguments now declared, recevie information passed to the function.
Within the body of the function these arguments can be used as local variables: Assignments can be made to them, and can be used in statements.
Hope this will help...
j@ck_
Assignments can be made to them, and can be used in statements within that function !...
sorry about that..
j@ck_