Renesas Technology, Tools FAQs
Last Updated: August 25, 2000
Document Number: 01051244_e
Q.
In a C language program, if I declare two variables with the same name and same type in the same file, will an error be generated?
A.
No, neither an error nor a warning will be generated.
This is in compliance with the ANSI specifications:
- There can be multiple external declarations for variables of the same name in one file, as long as the type assigned to that
name does not differ.
Example 1: No error generated
int i;
int i=1;
main()
{
}
Example 2: Duplicate definition error generated
int i;
char i;
main()
{
}
●
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Comentarios a estos manuales