3 回答

TA貢獻(xiàn)1895條經(jīng)驗(yàn) 獲得超3個贊
Visual Studio 2005中新增了__super關(guān)鍵字,它代表本類的基類,因此可以像下面這樣使用:
struct B1 {
void mf(int) {}
};
struct B2 {
void mf(short) {}
void mf(char) {}
};
struct D : B1, B2 {
void mf(short) {
__super::mf(1); // Calls B1::mf(int)
__super::mf('s'); // Calls B2::mf(char)
}
};
它還可以配合using語句使用,比如using __super::type_define;

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超5個贊
沒有!!!
如果下次要看是否為C++中的關(guān)鍵字
在程序中輸入是否跟int.float的顏色一樣
是,則為關(guān)鍵字
不是,則不是關(guān)鍵字!!!

TA貢獻(xiàn)1868條經(jīng)驗(yàn) 獲得超4個贊
C++關(guān)鍵字
C++關(guān)鍵字列表
關(guān)鍵字是預(yù)先保留的標(biāo)識符,每個關(guān)鍵字都有特殊的含義。我們不能在程序中使用與關(guān)鍵字同名的標(biāo)識符。以下是C++所保留的關(guān)鍵字
asm[1]
auto
bad_cast
bad_typeid
bool
break
case
catch
char
class
const
const_cast
continue
default
delete
do
double
dynamic_cast
else
enum
except
explicit
extern
false
finally
float
for
friend
goto
if
inline
int
long
mutable
namespace
new
operator
private
protected
public
register
reinterpret_cast
return
short
signed
sizeof
static
static_cast
struct
switch
template
this
throw
true
try
type_info
typedef
typeid
typename
union
unsigned
using
virtual
void
volatile
while
[1] 為了與其他C++實(shí)現(xiàn)保持兼容而保留的,并未實(shí)現(xiàn)。在VC環(huán)境中,請使用 __asm。
添加回答
舉報