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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -