answersLogoWhite

0

I guess you wanted to ask, why is it scanf ("%s", array)and not scanf ("%s", &array).

Well, array is by definition a pointer to the first element: array = &array[0]

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How can we read two strings using c program?

#include,stdio.h>main(){char string1[20],string2[20]printf("enter the first string");scanf("%s",string1);// reading the string1printf("enter the second string");scanf("%s", string2);// reading the the string2printf( "the first string is %s",string1);// printing the string1printf("the second string is %s",string2);// printing the string2}the problem of using scanf is that it does not take space. so we can use gets for it.ie instead of scanf("%s",string1); we can use gets(string1); .


Write a scanf statement to read the 78b45?

To read the string "78b45" using scanf, you can use the following statement: char input[6]; // Ensure the array is large enough to hold the string and the null terminator scanf("%5s", input); // Read up to 5 characters This will read up to 5 characters into the input array, allowing for the input "78b45" to be stored correctly.


What are the components of print f and scan f?

printf: format string + value list scanf: format string + address list


What is the purpose of scanf in c language?

scanf is used for reading formatted data from stdin. The general syntax is:scanf( format , arguments);For more information on scanf, visit the link below.


Can you use scanf to get a string to a c program?

Certainly. That's what sequence %s is good for.


C program to accept a sentence using scanf?

scanf ("%[^\n]s", sentence);


What are the limitations of getchar and scanf functions for strings?

cause getchar only read a character and scanf read only word before first space but not other words and letters.


What happens by the 'scanf' statement in C programming language?

By using the scanf statement in c,we can take the values at run time . for ex a is a variable of type int so, we can assign the value of a using scanf at run time as follows. scanf("%d",&a); here %d is the conversion specifier for integer type.


Program to find palindrome using C programming?

#include<stdio.h> #include<conio.h> #include<string.h> void main() { char a[15],b[15]; printf("Enter the string\n"); scanf("%s",&a); strcpy(b,a); strrev(a); if(strcmp(a,b)==0) printf("The String is a palindrome"); else printf("The String is not a palindrome"); }


What is the prototype of scanf in c programmin?

int scanf(char* format, ...); the format accepts the format specifier string, the elipsis operator accepts the variable list scanf("var type var type ...", &var, &var, ...); example: int num1, num2, num3; scanf("%d %d %d",&num1,&num2,&num3); Is that what you were looking for? Maybe this can help also...


How do you read input buffer of keyboard using C?

scanf();


Program to find the size of the string in c?

int main (void) { char buf[1024]; scanf ("Enter a string: %s", buf); printf ("The length of the string is %d chars long.\n", strlen (buf)); return 0; }