I'm trying to create a program (in c) which will have 2 options, Read and Write an NFC at Block level and I compile/execute it from my Raspberry Pi (i.e.from terminal/bash).
What I'm trying to achieve in this program is something like this :
- ./ProgName -r /file.txt
Read the NFC and send the output to file.txt
- ./ProgName -w /file.txt
Copy to NFC what is written in file.txt
My question is : How do I create "-r" and "-w" options?
I don't know what are they called and how are they compiled/made/created. I have a vague idea that it's something concerning argc/argv but I'm not sure.
bash?main().int main( int argc, char *argv[] ),argcgives you arguments length, inargvyou can iterate over each arguments