Ò»¸ö¼òµ¥µÄCÎÊÌâ - C/C++ / CÓïÑÔ
What is displayed when f() is called given the code:
class Number {
public:
string type;
Number(): type( ¡° void ¡± ) { }
explicit Number(short) : type( ¡° short ¡± ) { }
Number(int) : type( ¡° int ¡± ) { }
};
void Show(const Number& n) { cout << n.type; }
void f()
{
short s = 42;
Show(s);
}
a) void
b) short
c) int
d) None of the above
ÕâµÀÌâÄ¿µÄ´ð°¸ÊÇC£¬ÎÒÏëÎʵÄÊÇ Ê²Ã´Çé¿öÏ»áµ÷ÓÃNumber(short)?ÔÚÕâÀs´«ÈëµÄ²»¾ÍÊÇshortÀàÐÍÂð£¿
explicit ÏÞ¶¨µÄ¹¹Ô캯ÊýÓ¦ÏÔʾµ÷ÓÃʱ£º
short k = 50;
Number Nk(k); // ÕâÀïÏÔʾµ÷ÓÃ
Show(Nk); // Êä³öshort
ÄãµÄÌâÄ¿²¢·ÇÏÔʾµ÷Óã¬ËùÒÔshortÐͱ»×ª»»Îªint ÐÍÁË¡£
ÓÉÓÚexplicitµÄÏÞÖƵ¼Ö±àÒëÆ÷ÎÞ·¨Ê¹ÓÃshortÀàÐ͹¹ÔìNumber
ÔÒòlsÓÐ˵Ã÷
ËùÒÔÖ»ÄÜÏȽ«sÒþʽת»»³ÉintÐÍ ÔÙµ÷ÓÃNumber(int)
ÒòΪÕâ¸ö¹¹Ô캯ÊýûÓÐÓÃexplicitÏÞÖÆ
Ïà¹ØÎÊ´ð£º
±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆڶԼܹ¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæʱ»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£
ËùÒÔÌصØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
ËÄÜ°ïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆ̨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£ ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
Ï£Íû¸ø´ó¼ÒÌṩһЩеÄ˼·.
ÎÒÃÇÔÚʹÓÃC±à³Ìʱ»áÓöµ½Ò»¸öÎÊÌ⣬±ÈÈçÍ·ÎļþµÄÒ»¸öº¯Êý°üº¬ÔÚÒ»¸ölib ÖУ¬µ«ÊÇ
ÔÚʵ¼ÊÁ¬½ÓÖÐÎÒÃDz»ÖªµÀËüÔÚÄĸö¿âÖС£Ò²Ðí¿ÉÐеÄÒ»ÖÖ°ì·¨ÊÇÖ±½ÓÉÏÍø²éѯij¸ö
º¯ÊýµÄÒÀÀµÌõ¼þ£¬Õâ¶Ô ......