Un initialized variables declared with the "static" keyword are initialized to zero. Such variables are implicitly initialized to the null pointer if they are pointers, and to 0.0F if they are floating point numbers.
Local variables start out containing garbage, unless they are explicitly initialized.
Memory obtained with malloc() and realloc() is likely to contain junk, and must be initialized. Memory obtained with calloc() is all-bits-0, but this is not necessarily useful for pointer or floating-point values (This is in contrast to Global pointers and Global floating point numbers, which start as zeroes of the right type).
Local variables start out containing garbage, unless they are explicitly initialized.
Memory obtained with malloc() and realloc() is likely to contain junk, and must be initialized. Memory obtained with calloc() is all-bits-0, but this is not necessarily useful for pointer or floating-point values (This is in contrast to Global pointers and Global floating point numbers, which start as zeroes of the right type).
And also read
- Does C have boolean variable type?
- Where may variables be defined in C?
- To what does the term storage class refer? What are auto, static, extern, volatile, const classes?
- What does the typedef keyword do?
- What is the difference between constants defined through #define and the constant keyword?
- What are Trigraph characters?
- How are floating point numbers stored? Whats the IEEE format?
- When should a type cast be used?
- Can structures be assigned to variables and passed to and from functions?
No comments:
Post a Comment