Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   how to insert variable's value? (http://www.mac-forums.com/forums/os-x-development-darwin/301070-how-insert-variables-value.html)

LauM86 07-15-2013 09:09 AM

how to insert variable's value?
 
hello, i have to insert the value of variables but when i write " ./a.out" command i can't insert them. The output i see from my console is: Usage: ./a.out <seed> <N_samples> <N_classes> <rho_class0> <serv_class0> <rho_class1> <serv_class1> ...
how can i do?
Thanks

cradom 07-15-2013 10:31 AM

Usually switches and/or variables are preceded by a -
For example: ./a.out -123 -foo etc.
Just curious, what exactly is a.out?

EDIT: Looked it up: https://en.wikipedia.org/wiki/A.out
If it is this, you're not finished with your compile.

vansmith 07-15-2013 10:53 AM

Moved to a more appropriate forum.

Do you have any sample code that we can look at from the section/method that handles switches?

Dysfunction 07-16-2013 01:11 AM

Quote:

Originally Posted by cradom (Post 1526270)
Usually switches and/or variables are preceded by a -
For example: ./a.out -123 -foo etc.
Just curious, what exactly is a.out?

EDIT: Looked it up: https://en.wikipedia.org/wiki/A.out
If it is this, you're not finished with your compile.

Doesn't have to be compiled, could be an interpreted language. No matter what, not enough info to even begin.

Raz0rEdge 07-16-2013 09:38 AM

Code:

$ cat t1.c
#include <stdio.h>

int main(void)
{
    printf("Hello World\n");

    return 0;
}

My super secret code...sshhhh..

Code:

$ gcc t1.c
$ ls
a.out t1.c

By default, gcc creates the output named a.out, I would fix that with the call
Code:

$gcc t1.c -o t1
But based on the usage line that you are getting, the program just seems to expect a series of arguments passed in THAT order..

Cradom eluded to argument modifiers that allow people to pass arguments in ANY order, but this program might not support that..


All times are GMT -4. The time now is 03:33 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.