When running bash scripts in a terminal $1 will represent the value entered after the program.
Example: typed(a bash script)
#!/bin/bash
echo "You typed: " $1
when you enter "./typed something" in a terminal you will get "You typed: something" back.
I would like to know how to do "./a.out test" and have test be the value of std::string userinput
my code:
#include <iostream>
std:string userinput;
int main() {
std::cout << "You typed: " << userinput << "\n";
return 0;
}