scanf, "%79s", what means 79?

Hello, ALl!
Please, I am reading the tutorial and I don't understand what is the meaning of 79 in next expression:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  
[/c/* scanf example */
#include <stdio.h>

int main ()
{
  char str [80];
  int i;

  printf ("Enter your family name: ");
  scanf ("%79s",str);   

  return 0;
}
Last edited on
http://www.cplusplus.com/reference/cstdio/scanf/

That page has all the info you should need.
Hello!
It means, if it would be:

1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>

int main ()
{
  char str [80];
  int i;

  printf ("Enter your family name: ");
  scanf ("%3s",str);   

  return 0;
}


Then it would read only first 3 letters (Sul).

It is then saved in a kind of string, but where exaclty and how can we reach this ?

Many thanks!!!
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>

int main ()
{
  char str [80];
  int i;

  printf ("Enter your family name: ");
  scanf ("%3s",str);   
 
  printf("You entered \"%s\"", str) ;

}
Topic archived. No new replies allowed.