general problems faced in scanf function......(plzzzzzz...answer in simple...)
scanf is a function that can be used for various number of variables.. it is defined as scanf(const char *,...), the first part is a string that gives the program to understand what data types you want to scanf for (in simple terms).The most basic data types are: %s ->string %d -> integer %ld -> long integer %llu -> long long unsigned integer %d ->simple integer %c -> character and remeber when you pass a variable in the function you have to use the & sign because the scanf function scans for pointers, not variables.Not putting the & sign can cause a segmentation fault. example: scanf("%d %d %d", &number1,&number2,&numbers3); scans for 3 integers and saves the result in number1,number2 and number 3..
Join our real-time social learning platform and learn together with your friends!