Can someone please tell me the difference between an automatic and a static variable?
Also, what is the difference betweenCode:#include "stdio.h" and #include <stdio.h>
Can someone please tell me the difference between an automatic and a static variable?
Also, what is the difference betweenCode:#include "stdio.h" and #include <stdio.h>
when putting them in quotes, it looks for the header where your code is saved, if it's in the less than and greater than symbol, the compiler looks for it in its include folder
More precisely, the search order for "file" is
1) Project include directories. (Usually current working directory and directory of including file.)
2) System include directories. (Specified in the compiler/project options.)
For <file> it's
1) System include directories.
By convention you always use <> for foreign headers, i.e. those you didn't write for this project.
As for automatic and static, the short version is that an automatic variable exists only as long as the function it's in is executed. A static variable lives from first execution of the function to the end of the program. (And thus, for example, preserves its value between calls to the function.)
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
One more question...what is the difference between
What does a single quote do compared to a double quote?Code:'A' and "A"
single quotes are for single characters and double quotes are for strings
Do you even have a 'C' book to read?
Actually
"A" is a nameless const char[] of size 2.
'A' is a nameless const char.
Last edited by Ezzetabi; 12-18-2005 at 04:07 AM.