c++有关对象的重复定义问题
来源:百度知道 编辑:UC知道 时间:2024/06/11 06:39:03
//说明Time是一个类
//问题,为什么t1不管是动态的,静态的都可以这样重复定义
void main()
{
int i=0;
Time t1;
if(1)
{
Time t1;
if(1)
{
static Time t1;
if(1)
{
static Time t1;
}
}
}
}
//问题,为什么t1不管是动态的,静态的都可以这样重复定义
void main()
{
int i=0;
Time t1;
if(1)
{
Time t1;
if(1)
{
static Time t1;
if(1)
{
static Time t1;
}
}
}
}
在不同的区域内,存在同名覆盖问题(动态),静态则不存在重定义问题。。
c++有关对象的重复定义问题
悬赏分:0 - 离问题结束还有 14 天 23 小时
//说明Time是一个类
//问题,为什么t1不管是动态的,静态的都可以这样重复定义
void main()
{
int i=0;
Time t1;
if(1)
{
Time t1;
if(1)
{
static Time t1;
if(1)
{
static Time t1;
}
}
}
}