Results 1 to 5 of 5

Thread: C : What is the vscanf()

  1. #1
    Join Date
    Dec 2009
    Posts
    33

    C : What is the vscanf()

    Hello, Friends. I am student of the MCA first year. I know basics of the C language. Periodically, I have to submit the assignments in college. In next week I have to submit the assignment on the vscanf() function. I have the knowledge about the scanf() function, But I do not know anything about the vscanf() function. So, I would like to know what is the vscanf() function, How they can be implement in the C program. Can anyone know about the vscanf() function.

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    C : vscanf()

    I think that except the argument list replaced by a pointer to a list of arguments, vscanf() function can be functionally similar to the scanf() function. This pointer must be of type v_lst, that can be defined in the header file. The following is the syntax of the vsscanf() function :
    #include <stdarg.h>
    #include <stdio.h>
    int vscanf( const char *frmt, v_lst arg );

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    C : vscanf()

    Hi, Under control of the argument format the vscanf() function can scans input from the file that can be designated by stdin. The format of the string can be explained under the description of the scanf() function. With a variable argument list that can be replaced with arg the vscanf() function can be similar to the scanf() function, that has been initialized using the v_strt() macro. Whenever the scanning can be ended by reaching at the end of the input stream, EOF is reached.

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: C : What is the vscanf()

    #include <stdio.h>
    #include <stdarg.h>
    void find( char *frmt, ... )
    {
    v_lst arglst;
    v_strt( arglst, frmt );
    vscanf( frmt, arglst );
    v_end( arglst );
    }
    void main()
    {
    int d, y;
    char wekd[10], mont[12];
    find( "%s %s %d %d",
    wekd, mont, &d, &y );
    printf( "\n%s, %s %d, %d\n",
    wekd, mont, d, y);
    }

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    What is the vscanf()

    One more example that help's you to know about the vscanf() function :
    #include <stdio.h>
    #include <stdarg.h>
    void get_msg(char *frmt, ...)
    {
    v_lst pt;
    v_str(pt, frmt);
    vscanf(frmt, pt);
    v_end(pt);
    }
    int main(void)
    {
    int k;
    printf(" INTEGER : ");
    get_msg(" %d ", &k);
    printf("%d", k);
    return 0;
    }

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,064,228.31793 seconds with 15 queries