how to get a pattern from command line?
i would like to get a string pattern parsed in by the user in command line

for example: on linux when the user types in 

./program -p hello

in the command line, i would like to get the string pattern "hello"

right now i have this...

      while(argc != 3){
               pattern = argv[optind]
      }

but when i printf("%s", pattern); terminal prints endless (null)

i have working code for while(argc != 0), while(argc != 2) already for other parts of the getopt.  

how to get a pattern from command line?
===

i would like to get a string pattern parsed in by the user in command line

for example: on linux when the user types in 

./program -p hello

in the command line, i would like to get the string pattern "hello"

right now i have this...

      while(argc != 3){
               pattern = argv[optind]
      }

but when i printf("%s", pattern); terminal prints endless (null)

i have working code for while(argc != 0), while(argc != 2) already for other parts of the getopt.  
