OiO.lk Blog C++ Why can I see the shell variable with argv?
C++

Why can I see the shell variable with argv?


So, I was testing something with argc and argv in C language, and i discovered this.

#include <stdio.h>

int main(int argc, char *argv[])
{
    printf(%s\n", argv[2]);
}

I compile it and rum this from my terminal like this ./a.out, and the result is SHELL=/bin/bash, my shell variable…
I use foot, the default terminal of sway.

I just want to know why. First time here by the way 🙂



You need to sign in to view this answers

Exit mobile version