C Programming - Typedef - Discussion

Discussion Forum : Typedef - Yes / No Questions (Q.No. 4)
4.
typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect.
Yes
No
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Lovely said:   1 decade ago
Yes it is possible.

Karthik said:   1 decade ago
For eg.,

{
typedef char c;
c c1;//c is char
{
typedef int c;
c d1;//c is int
}
}

But #define always has global scope till the end of the file.

Swathi said:   1 decade ago
#define function used in globally. We can access that data in the program any where.

Yash said:   8 years ago
Yes, right, @Karthik.

Post your comments here:

Your comments will be displayed after verification.