top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How can I view the statements inside a scanf() function?

+3 votes
How can I view the statements inside a scanf() function?
posted Oct 5, 2016 by Prajwal C.m.

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote
Best answer

Hi Prajwal see this header file stdio.h at C:\Program Files (x86)\CodeBlocks\MinGW\include and after removing the preprocessors,you will find scanf() function with its statement like below :

 int scanf(const char *fmt, ...) {
  int rc;
  va_list args;

  va_start(args, fmt);

  rc = _input(stdin, fmt, args);

  return rc;

here it also includes stdarg.h and stddef.h where these functions used inside scanf() are defined.

answer Oct 5, 2016 by Shivam Kumar Pandey
+1 vote

scanf() function definition is inside scanf.c
scanf.c - sanos source
stdio.h contains only the function declarations
stdio.h - sanos source

answer Oct 6, 2016 by Rajat Dubey
@Rajat what is sanos source ? and where to search for scanf.c in our system?
Similar Questions
+5 votes

Can we realloc a string inside a structure?

struct info
     char name[20];
     int age;
     char address[20];

struct info d[10];

I want to realloc name, how can I do it?

+7 votes

I have a function pointer that contains the address of function. I do not want any linux function. I want to compile my code with gcc without any option.
gcc -g my_code.c only.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.