taking and holding input

Posted by gcc on Stack Overflow See other posts from Stack Overflow or by gcc
Published on 2010-05-02T19:55:39Z Indexed on 2010/05/02 19:57 UTC
Read the original article Hit count: 133

Filed under:
i tried to take input from user
input like that 

input::
 first line:>>name(white space)last name
 second line:>>identification number(white space)birtdate(,,:,,:)
 third line:>>lesson which he take  (ce140 ce213 ce383...)
 last line:>>note he take(80 60 ......)

this input type for each student 

i tried to hold this input in struct like

   struct name is first line 
      {
             second line
              third line
               last line

         }

my testing

   scanf("%[^\n]\n);       take input hold in string
  scanf("%s",...secondline_name);      storing in secondline_name
  . 
   .
    .

but this doesnot work are there any other way to hold input

© Stack Overflow or respective owner

Related posts about c