Can any one tell me how to return the output of a program in a variable from command line?
var = ./a.out params
I am trying to get the outp
To complement the answer from rasen, to get the variable from inside your program to the external environment, you need to print it to stdout.
stdout
Using the syntax provided in the other answer simply takes all output from stdout and puts it in the shell environment variable var.
var