I have two questions about C ++ programming.
1) int a[10] = new int*;is this statement valid?
int a[10] = new int*;
2) extern void test(int a,int b) throw(const char *, RangeErr);
extern void test(int a,int b) throw(const char *, RangeErr);
what does test () do, throw (const char *, RangeErr) means throw two exceptions? and what is RangeErr? and why extern? what does this function do?
1) Not valid. An array is not a pointer (although it can be implicitly converted to one in some contexts). Try instead:
int* a = new int[10];
2) ( ). , " ", , . , "".
throw , ( C- RangeErr, , , , ). - , std:: (), . , , , , , ++ 11 .
. . , .
, , , . throw , , C RangeErr, . RangeErr . extern , .
throw
RangeErr
extern
throw . , throw () , , . . " " Herb Sutter, - ++.
throw ()
1) . .
2) test() - . throw(...) , . RangeErr - . extern , (.. ).
test()
throw(...)
1), No
2), , "const char *" "RangeErr". , RangeErr , , , , . , (dll, - ), api , , . ^^ , .