how to insert variable's value?

Joined
Jul 15, 2013
Messages
1
Reaction score
0
Points
1
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
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Moved to a more appropriate forum.

Do you have any sample code that we can look at from the section/method that handles switches?
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
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

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
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..
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top