我想要具有相同名称但使用不同名称空间的函数。我宣布在命名空间中的函数:名称空间中的函数
GPS.cpp
namespace NSpace_IMUandGPS
{
//Read GPS Data Set Raspberry Pi's Time and date
void ReadGPS(FD &Fd, bool &GPSready, bool &TimeConfigured, S_POS &POS, S_GPS&GPS, S_IMU &IMU, double &Velocity)
{
...
}
}
GPS.h
namespace NSpace_IMUandGPS
{
void ReadGPS(FD &Fd, bool &GPSready, bool &TimeConfigured, S_POS &POS, S_GPS &GPS, S_IMU &IMU, double &Velocity);
}
Main.cpp的
我想在main中使用未在NSpace_IMUandGPS命名空间中声明的结构。那么,我该怎么做?如果我在名称空间中声明函数,是否所有变量都必须在相同的名称空间中定义?