Why does the call char scanf work?
Submitted by: AdministratorWhy does the call
char s[30];
scanf("%s", s);
work? I thought you always needed an & on each variable passed to scanf.
You always need a pointer; you don't necessarily need an explicit &. When you pass an array to scanf, you do not need the &, because arrays are always passed to functions as pointers, whether you use & or not.
Submitted by: Administrator
char s[30];
scanf("%s", s);
work? I thought you always needed an & on each variable passed to scanf.
You always need a pointer; you don't necessarily need an explicit &. When you pass an array to scanf, you do not need the &, because arrays are always passed to functions as pointers, whether you use & or not.
Submitted by: Administrator
Read Online C Programming Job Interview Questions And Answers
Top C Programming Questions
☺ | Why does this code crash? |
☺ | What is wrong with this declaration? |
☺ | How can I read/write structures from/to data files? |
☺ | What does static variable mean in c? |
☺ | How can I increase the allowable number of simultaneously open files? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |