"Allan Wu" <23*1*3*
8@s*u*e*t*u*a*e*u*a*> wrote:
> Hello, I was wondering if I could get clarification on the topic of passing optional command-line arguments.
>
> In the original project description, under the heading of "The steps to compile and execute an ml program", Step 6 is stated:
>
> "6. runml executes the compiled C11 program ml-12345, passing any optional command-line arguments (real numbers)"
>
> I believe this means the compiled program would need to accept arguments argv[1], argv[2]... and convert them to real-valued variables arg0, arg1 etc. The compiled program ml-12345 would need main(int argc, char *argv[]) to process this
You don't need to do this. The arguments are "passed in" into the variables arg0, arg1, etc.
> This is more difficult than directly writing the values into the C file during translation (Step 4). For example, I could write a format string "double arg0 = %s;", argv[2]. In this simpler case, main() of ml-12345 does not need to accept any command line arguments.
This is what you are meant to do.
> Is my understanding of this part of the project correct? Should we be following the original project description or is it acceptable to do the simpler task?
>
> Thanks in advance for the help.
np