title: Using scanf() delimiters not working as expected
body: <p>I have a string input that goes like this</p>
  
  <p><code>string@floatValue</code></p>
  
  <p>A set of values in this format is being passed as an input to the program. I am trying to read them using <code>scanf()</code> but to no avail.</p>
  
  <p>Some of the formats that I have tried are</p>
  
  <p><code>scanf("%[^@]s%f",&amp;s,&amp;f);</code></p>
  
  <p><code>scanf("%s@%f",&amp;s,&amp;f);</code></p>
  
  <p><code>scanf("%s[@]%f",&amp;s,&amp;f);</code></p>
  
  <p>No matter what I give the whole value (the string with the @ symbol and the float value) is being stored in the s itself.</p>
  
  <p>In a previous post I saw someone using this <code>%4[^\n]</code>which can be used to read 4 inputs or until a new line is encountered. Unfortunately the input size is not known to me. I tried a workaround using <code>getchar()</code> function. In that too after reaching '@' symbol I am using <code>scanf("%f",&amp;f)</code> to read the input, which is throwing me segmentation error. How can I solve this?</p>