How will you explain Static and Auto data types to a layman? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How will you explain Static and Auto data types to a layman?

This is with regard to C language. I have tried it on google but the results have got me a bit confused so I decided to ask here

16th Sep 2017, 7:36 PM
Siraz Naorem
Siraz Naorem - avatar
3 Answers
0
static variables are available during all the execution of the program. auto variable is only available inside the function where the variable was declared and when that function finish it's execution, the auto variable stops its existence. you can access a static variable during all the execution of the program but you can't access a auto variable outside the function where it was declared.
17th Sep 2017, 2:16 AM
sebipincha
sebipincha - avatar
0
That sounds too similar to local and global variables :/
17th Sep 2017, 6:49 AM
Siraz Naorem
Siraz Naorem - avatar
0
in fact it is related
17th Sep 2017, 5:12 PM
sebipincha
sebipincha - avatar