Skip to content
← Back to Community
main args in C
Profile icon
n0tch

Hello!
The 'input' button in the right side of the console is used to recieve the arguments to the main function?

I'm using it and sendding an arbtrary number of arguments but the argc is always getting 1 as value, the filename.

I'm using this code:

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

I also used the **argv as argument...

I need an extra configuration to get the main function arguments?
Can someone help me?
Thx!

Voters
Profile icon
Khaliun123
Profile icon
MatThuries
Profile icon
dmalani1
Profile icon
javiolonchelo
Profile icon
8yECaTxc
Profile icon
n0tch