Entering no character for input in C -


is there way user enter nothing input(for character array) in c? tried following:

  1. using '\n' character delimiter: scanf("%[^\n]s",str); gave me junk.
  2. used custom delimiter ' ` '. additional task required in case if entered in between, etc.
  3. tried using command line arguments input string (as know no input gives one argument expected)
  4. tried entering null alt+space. did not work either.

please suggest me new way or correct me if doing of above steps wrong. note: using windows.

if take input command line arguments, can specify empty string with:

c:\>myprogram "" 

argc 2 , argv[1] pointer empty string.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -