C++ÊÔÌâ¼°´ð°¸ ÏÂÔر¾ÎÄ

{protected:

int wheels;//³µÂÖÊý float weight;//ÖØÁ¿ public:

void init(int wheels,float weight); int get_wheels(); float get_weight(); void print(); };

void vehicle::init(int wheels,float weight) {this->wheels=wheels; this->weight=weight; cout<

int vehicle::get_wheels() {return wheels; }

float vehicle::get_weight() {return weight;}

void vehicle::print()

{cout<<\³µÂÖÊý£º\ÖØÁ¿£º\´ð°¸£ºclass car:public vehicle {private:int passengers; public:

void init(int wheels,float weight,int pass); int getpassenger(); void print();}£»

void car::init(int wheels,float weight,int pass) {vehicle::init(wheels,weight); passengers=pass;}

int car::getpassenger() {return passengers;} void car::print() {vehicle::print();

cout<<\¿ÉÔØÈËÊý£º\}__

C++³ÌÐòÉè¼ÆÄ£ÄâÊÔ¾í(Îå)

Ò»¡¢µ¥ÏîÑ¡ÔñÌâ(±¾´óÌâ¹²20СÌ⣬ÿСÌâ1·Ö£¬¹²20·Ö)ÔÚÿСÌâÁгöµÄËĸö±¸Ñ¡ÏîÖÐ Ö»ÓÐÒ»¸öÊÇ·ûºÏÌâÄ¿ÒªÇóµÄ£¬Ç뽫Æä´úÂëÌîдÔÚÌâºóµÄÀ¨ºÅÄÚ¡£´íÑ¡¡¢¶àÑ¡»òδѡ¾ùÎÞ ·Ö¡£

1. ¾²Ì¬³ÉÔ±º¯ÊýûÓУ¨£© A. ·µ»ØÖµ B. thisÖ¸Õë C. Ö¸Õë²ÎÊý D. ·µ»ØÀàÐÍ ´ð°¸£ºB

½âÎö£º¾²Ì¬³ÉÔ±º¯ÊýÊÇÆÕͨµÄº¯ÊýÇ°¼ÓÈëstatic,Ëü¾ßÓк¯ÊýµÄËùÓеÄÌØÕ÷£º·µ»ØÀàÐÍ¡¢ ÐβΣ¬ËùÒÔʹÓþ²Ì¬³ÉÔ±º¯Êý£¬Ö¸Õë¿ÉÒÔ×÷ΪÐβΣ¬Ò²¾ßÓзµ»ØÖµ¡£¾²Ì¬³ÉÔ±ÊÇÀà¾ßÓеÄ

ÊôÐÔ£¬²»ÊǶÔÏóµÄÌØÕ÷£¬¶øthis±íʾµÄÊÇÒþ²ØµÄ¶ÔÏóµÄÖ¸Õ룬Òò´Ë¾²Ì¬³ÉÔ±º¯ÊýûÓÐthis Ö¸Õë ¡£¾²Ì¬³ÉÔ±º¯Êýµ±ÔÚÀàÍⶨÒåʱ£¬Òª×¢Òâ²»ÄÜʹÓÃstatic¹Ø¼ü×Ö×÷Ϊǰ׺¡£ÓÉÓÚ¾²Ì¬³ÉÔ±º¯ÊýÔÚ ÀàÖÐÖ»ÓÐÒ»¸ö¿½±´£¨¸±±¾£©£¬Òò´ËËü·ÃÎʶÔÏóµÄ³ÉԱʱҪÊܵ½Ò»Ð©ÏÞÖÆ£º¾²Ì¬³ÉÔ±º¯Êý¿ÉÒÔÖ±½Ó ·ÃÎÊÀàÖÐ˵Ã÷µÄ¾²Ì¬³ÉÔ±£¬µ«²»ÄÜÖ±½Ó·ÃÎÊÀàÖÐ˵Ã÷µÄ·Ç¾²Ì¬³ÉÔ±£»ÈôÒª·ÃÎʷǾ²Ì¬³ÉԱʱ£¬±Ø Ðëͨ¹ý²ÎÊý´«µÝµÄ·½Ê½µÃµ½ÏàÓ¦µÄ¶ÔÏó£¬ÔÙͨ¹ý¶ÔÏóÀ´·ÃÎÊ¡£

2. ÔÚÀàµÄ¶¨ÒåÖУ¬ÓÃÓÚΪ¶ÔÏó·ÖÅäÄÚ´æ¿Õ¼ä£¬¶ÔÀàµÄÊý¾Ý³ÉÔ±½øÐгõʼ»¯²¢Ö´ÐÐÆäËûÄÚ²¿¹Ü Àí²Ù×÷µÄº¯ÊýÊÇ£¨£© A. ÓÑÔªº¯Êý B. Ð麯Êý C. ¹¹Ô캯Êý D. Îö¹¹º¯Êý ´ð°¸£ºC

½âÎö£º¶¨Òå¹¹Ô캯Êý×÷ÓþÍÊdzõʼ»¯¶ÔÏ󣬶øÎö¹¹º¯ÊýÊͷŶÔÏó¿Õ¼ä¡£Ð麯ÊýÓÃÓÚÍê³É¶à ̬ÐÔ£¬ÓÑÔªÔö¼Ó·ÃÎÊ·½±ãÐÔ¡£

3. ËùÓÐÔÚº¯ÊýÖж¨ÒåµÄ±äÁ¿£¬¶¼ÊÇ£¨£© A. È«¾Ö±äÁ¿

B. ¾Ö²¿±äÁ¿ C. ¾²Ì¬±äÁ¿ D. ¼Ä´æÆ÷±äÁ¿ ´ð°¸£ºB

½âÎö£º±äÁ¿´æ´¢Àà¿É·ÖΪÁ½Àࣺȫ¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£

£¨1£©È«¾Ö±äÁ¿£ºÔÚº¯ÊýÍⲿ¶¨ÒåµÄ±äÁ¿³ÆΪȫ¾Ö±äÁ¿£¬Æä×÷ÓÃÓòΪ£º´Ó¶¨Òå±äÁ¿µÄλÖÿªÊ¼ µ½Ô´³ÌÐò½áÊø¡£È«¾Ö±äÁ¿Ôö¼ÓÁ˺¯ÊýÖ®¼äÊý¾ÝÁªÏµµÄÇþµÀ£¬È«¾Ö±äÁ¿×÷ÓÃÓòÄڵĺ¯Êý£¬¾ù¿ÉʹÓà ¡¢Ð޸ĸÃÈ«¾Ö±äÁ¿µÄÖµ£¬µ«ÊÇʹÓÃÈ«¾Ö±äÁ¿½µµÍÁ˳ÌÐòµÄ¿ÉÀí½âÐÔ£¬Èí¼þ¹¤³ÌѧÌᳫ¾¡Á¿±ÜÃâʹ ÓÃÈ«¾Ö±äÁ¿¡£

£¨2£©¾Ö²¿±äÁ¿£ºÔÚº¯ÊýÄÚ²¿¶¨ÒåµÄ±äÁ¿³ÆΪ¾Ö²¿±äÁ¿£¬Æä×÷ÓÃÓòΪ£º´Ó¶¨Òå±äÁ¿µÄλÖÿªÊ¼ µ½º¯Êý½áÊø¡£¾Ö²¿±äÁ¿°üº¬×Ô¶¯±äÁ¿£¨auto£©¾²Ì¬±äÁ¿£¨static£©ÒÔ¼°º¯Êý²ÎÊý¡£

auto±äÁ¿Òâζ×űäÁ¿µÄ´æ´¢¿Õ¼äµÄ·ÖÅäÓëÊÍ·ÅÊÇ×Ô¶¯½øÐеġ£ËµÃ÷·ûauto¿ÉÒÔÊ¡ÂÔ¡£º¯ÊýÖÐ µÄ¾Ö²¿±äÁ¿´æ·ÅÔÚÕ»¿Õ¼ä¡£ÔÚº¯Êý¿ªÊ¼ÔËÐÐʱ£¬¾Ö²¿±äÁ¿±»·ÖÅäÄÚ´æµ¥Ôª£¬º¯Êý½áÊøʱ£¬¾Ö²¿±ä Á¿ÊÍ·ÅÄÚ´æµ¥Ôª¡£Òò´Ë£¬ÈÎÁ½¸öº¯ÊýÖеľֲ¿±äÁ¿¿ÉÒÔͬÃû£¬ÒòÆäÕ¼Óв»Í¬µÄÄÚ´æµ¥Ôª¶ø²»Ó°Ïì ʹÓá£ÕâÓÐÀûÓÚʵÏÖÈí¼þ¿ª·¢µÄÄ£¿é»¯¡£

static±äÁ¿ÊǶ¨ÒåÔÚº¯ÊýÌåÄڵıäÁ¿£¬´æ·ÅÔÚ¾²Ì¬´æ´¢Çø£¬²»ÓÃÕ»¿Õ¼ä´æ´¢£¬ÆäÖµ²¢²»Ëæ´æ ´¢¿Õ¼äµÄÊͷŶøÏûʧ¡£

4. ¼Ù¶¨ABΪһ¸öÀ࣬ÔòÖ´ÐС°AB a(2), b£Û3£Ý,*p£Û4£Ý;¡±Óï¾äʱµ÷ÓøÃÀ๹Ô캯ÊýµÄ´ÎÊý Ϊ£¨£© A. 3 B. 4 C. 5 D. 9 ´ð°¸£ºB

½âÎö£º a(2)µ÷ÓÃ1´Î´ø²ÎÊýµÄ¹¹Ô캯Êý£¬b£Û3£Ýµ÷ÓÃ3´ÎÎÞ²ÎÊýµÄ¹¹Ô캯Êý£¬Ö¸ÕëûÓиøËü ·ÖÅä¿Õ¼ä£¬Ã»Óе÷Óù¹Ô캯Êý¡£ËùÒÔ¹²µ÷Óù¹Ô캯ÊýµÄ´ÎÊýΪ4¡£

5. Èç¹û±í´ïʽ++aÖеġ°++¡±ÊÇ×÷Ϊ³ÉÔ±º¯ÊýÖØÔصÄÔËËã·û£¬Èô²ÉÓÃÔËËã·ûº¯Êýµ÷Óøñʽ£¬Ôò ¿É±íʾΪ£¨£©

A. a.operator++(1) B. operator++(a) C. operator++(a,1) D. a.operator++() ´ð°¸£ºD

½âÎö£ºÔËËã·ûµÄÖØÔØ£¬Ç°×ºÏÈÈñäÁ¿±ä»¯¡£µ÷Óã«£«a£¬µÈ¼ÛΪa.operator++(),×¢ÒâÎ޲ΠµÄÐÎʽ¡£ºó׺µÄ»°a++,µÈ¼ÛÓÚa.operator(0),´øÐβΣ¬ÐβÎÃû¿ÉÊ¡¡£

6. ÒÑÖªf1ºÍf2ÊÇͬһÀàµÄÁ½¸ö³ÉÔ±º¯Êý£¬µ«f1²»ÄÜÖ±½Óµ÷ÓÃf2£¬Õâ˵Ã÷£¨£© A. f1ºÍf2¶¼ÊǾ²Ì¬º¯Êý

B. f1²»ÊǾ²Ì¬º¯Êý£¬f2ÊǾ²Ì¬º¯Êý C. f1ÊǾ²Ì¬º¯Êý£¬f2²»ÊǾ²Ì¬º¯Êý D. f1ºÍf2¶¼²»ÊǾ²Ì¬º¯Êý ´ð°¸£ºC

½âÎö£ºÆÕͨ³ÉÔ±º¯Êý¿ÉÒÔµ÷Óþ²Ì¬º¯Êý£¬Ïà·´¾²Ì¬º¯Êý²»Äܵ÷ÓÃÆÕͨ³ÉÔ±º¯Êý£¬ÕâÓëÆÕͨ º¯ÊýÓë³£³ÉÔ±º¯ÊýÏàͬ¡£Òò´ËÑ¡ÔñCÏî¡£

7. Ò»¸öº¯Êý¹¦Äܲ»Ì«¸´ÔÓ£¬µ«ÒªÇó±»Æµ·±µ÷Óã¬ÔòÓ¦°ÑËü¶¨ÒåΪ £¨£© A. ÄÚÁªº¯Êý B. ÖØÔغ¯Êý C. µÝ¹éº¯Êý D. ǶÌ׺¯Êý ´ð°¸£ºA

½âÎö£ºÄÚÁªº¯ÊýÌØÕ÷´úÂëÉÙ£¬Æµ·±µ÷Óã¬Ö´ÐÐЧÂʸߡ£ÖØÔغ¯Êý½â¾öͳһ½Ó¿ÚµÄÎÊÌ⣻µÝ

¹éÊÇ×Ó³ÌÐòµ÷Ó㬳ÌÐòµ÷ÓÃÒªºÄ·ÑºÜ¶à¿Õ¼äºÍʱ¼ä£¬Ñ­»·/µü´ú¶¼±ÈµÝ¹éÓÐЧÂʵö࣬µÝ¹éÖ»ÊÇ ´ÓÐÎʽÉÏ£¬Âß¼­±È½Ï¼ò½à¡£Ç¶Ì׺¯Êý¼´·´¸´µ÷Óã¬ËٶȽÏÂý¡£ËùÒÔÑ¡ÔñAÏî¡£ 8. ½â¾ö¶¨Òå¶þÒåÐÔÎÊÌâµÄ·½·¨ÓУ¨£© A. Ö»ÄÜʹÓÃ×÷ÓÃÓò·Ö±æÔËËã·û

B. ʹÓÃ×÷ÓÃÓò·Ö±æÔËËã·û»ò³ÉÔ±ÃûÏÞ¶¨ C. ʹÓÃ×÷ÓÃÓò·Ö±æÔËËã·û»òÐé»ùÀà D. ʹÓóÉÔ±ÃûÏÞ¶¨»ò¸³Öµ¼æÈݹæÔò ´ð°¸£ºB

½âÎö£º½â¾ö¶þÒåÐÔÎÊÌâÖ÷ÒªÒªÁ½ÖÖ·½·¨£º(1)¸³Öµ¼æÈݹæÔò£»(2)Ðé»ùÀà¡£

9. ÔÚmainº¯ÊýÖпÉÒÔÓÃp.aµÄÐÎʽ·ÃÎÊÅÉÉúÀà¶ÔÏópµÄ»ùÀà³ÉÔ±a£¬ÆäÖÐaÊÇ£¨£© A. ˽Óм̳еĹ«ÓгÉÔ± B. ¹«Óм̳еÄ˽ÓгÉÔ± C. ¹«Óм̳еı£»¤³ÉÔ± D. ¹«Óм̳еĹ«ÓгÉÔ± ´ð°¸£ºD

½âÎö£º¹«ÓгÉÔ±¿ÉÒÔÔÚÀàÍâ·ÃÎÊ£¬±£»¤ÀàÐͳÉÔ±¿ÉÒÔÔÚÅÉÉúÀàÖзÃÎÊ£¬µ«²»ÄÜÔÚÀàÍâ·ÃÎÊ

£¬ÔÚmainº¯ÊýÖзÃÎÊ£¬ËµÃ÷aÊǹ«ÓгÉÔ±¡£Ö»Óй«Óм̳Ðʱa²ÅÄÜÊǹ«Óеģ¬ËùÒÔDÏîÕýÈ·¡£ 10. ÔÚC++Öв»·µ»ØÈκÎÀàÐ͵ĺ¯ÊýÓ¦¸Ã˵Ã÷Ϊ£¨£© A. int B. char C. void D. double ´ð°¸£ºC

½âÎö£ºÎÞÐβλòÎÞ·µ»ØÖµ¶¼¿ÉÒÔÓÃvoidÀ´ÉùÃ÷£¬int char double·Ö±ðÊÇÕûÐÍ¡¢×Ö·ûÐͺÍʵÐÍ¡£ 11. ÈôSampleÀàÖеÄÒ»¸ö³ÉÔ±º¯Êý˵Ã÷ÈçÏ£º void set(Sample& a)£¬ÔòSample& aµÄº¬ÒåÊÇ£¨£© A. Ö¸ÏòÀàSampleµÄÃûΪaµÄÖ¸Õë

B. aÊÇÀàSampleµÄ¶ÔÏóÒýÓã¬ÓÃÀ´×÷º¯ÊýSet£¨£©µÄÐβΠC. ½«aµÄµØÖ·¸³¸ø±äÁ¿Set

D. ±äÁ¿SampleÓëa°´Î»ÓëµÄ½á¹û×÷Ϊº¯ÊýSetµÄ²ÎÊý ´ð°¸£ºB

½âÎö£º³ÉÔ±º¯ÊýʹÓöÔÏóµÄÒýÓÃ×÷ΪÐβΡ£¸Ãº¯ÊýµÄ¹¦ÄÜÊǽ«ÒÑÖª¶ÔÏóµÄËùÓÐÊý¾Ý³ÉÔ±µÄ Öµ¿½±´¸øÏàÓ¦¶ÔÏóµÄËùÓÐÊý¾Ý³ÉÔ±£¬²»»á½¨Á¢ÁÙʱ¶ÔÏó£¬ÕâÀïÊǶÔÏóµÄÒýÓÃËùÒÔÑ¡ÔñB¡£ 12. ҪʵÏÖ¶¯Ì¬Áª±à±ØÐ루£© A. ͨ¹ý³ÉÔ±ÃûÏÞ¶¨À´µ÷ÓÃÐ麯Êý B. ͨ¹ý¶ÔÏóÃûÀ´µ÷ÓÃÐ麯Êý C. ͨ¹ýÅÉÉúÀà¶ÔÏóÀ´µ÷ÓÃÐ麯Êý D. ͨ¹ý¶ÔÏóÖ¸Õë»òÒýÓÃÀ´µ÷ÓÃÐ麯Êý ´ð°¸£ºD

½âÎö£ºÍ¨¹ý»ùÀàÖ¸Õë»ò»ùÀàÒýÓÃÀ´µ÷ÓÃÐ麯ÊýʵÏÖ¶¯Ì¬¶à̬ÐÔ£¬¾²Ì¬¶à̬ÐÔͨ¹ýÖØÔØÀ´Êµ Ïֵġ£ËùÒÔÑ¡ÔñDÏî¡£

13. ÔÚÅÉÉúÀàÖж¨ÒåÐ麯Êýʱ£¬¿ÉÒÔÓë»ùÀàÖÐÏàÓ¦µÄÐ麯Êý²»Í¬µÄÊÇ£¨£© A. ²ÎÊýÀàÐÍ B. ²ÎÊý¸öÊý C. º¯ÊýÃû³Æ D. º¯ÊýÌå ´ð°¸£ºD

½âÎö£ºÐ麯ÊýÔÚ»ùÀàºÍÅÉÉúÀ࣬¾ßÓÐÏàͬµÄ·µ»ØÀàÐÍ¡¢ÐβÎÀàÐͺÍÐβθöÊý£¬¶øº¯ÊýÌå¿É ÒÔ¸ù¾Ý²»Í¬µÄÅÉÉúÀà»ò»ùÀàʵÏÖ²»Í¬µÄ²Ù×÷£¬¼´²»Í¬º¯ÊýÌå¡£ 14. ʵÏÖÁ½¸öÏàͬÀàÐÍÊý¼Ó·¨µÄº¯ÊýÄ£°åµÄÉùÃ÷ÊÇ£¨£© A. add(T x,T y) B. T add(x,y) C. T add(T x,y) D. T add(T x,T y) ´ð°¸£ºD

½âÎö£ºÊµÏÖÁ½¸öÏàͬÀàÐÍÊý¼Ó·¨½á¹ûÓ¦¸ÃºÍ²Ù×÷Êý¾ßÓÐÏàͬÀàÐÍ¡£½øÐмӷ¨ÔËËãºó½á¹ûÒ² ÊǺͲÎÊý¾ßÓÐÏàͬÀàÐÍ£¬ÐèÒª·µ»ØÖµ¡£AÎÞ·µ»ØֵʱҪÓÃvoid,BÐβÎÎÞÀàÐÍ£¬CÐβÎyûÓÐÀàÐÍ £¬ËùÒÔÑ¡ÔñDÏî¡£

15. ÏÂÁв»ÊÇÃèÊöÀàµÄ³ÉÔ±º¯ÊýµÄÊÇ£¨£© A. ¹¹Ô캯Êý B. Îö¹¹º¯Êý C. ÓÑÔªº¯Êý D. ¿½±´¹¹Ô캯Êý ´ð°¸£ºC

½âÎö£ºÓÑÔªº¯ÊýËäÈ»²»ÊdzÉÔ±º¯Êýµ«ÊÇ¿ÉÒÔ·ÃÎÊÀàËùÓгÉÔ±¡£¹¹Ô캯Êý¡¢Îö¹¹º¯ÊýºÍ¿½±´ ¹¹Ô캯Êý(¸´Öƹ¹Ô캯Êý)¶¼ÊÇÀàµÄÌØÊ⺯ÊýÓÃÓÚ¶ÔÏóµÄ´´½¨ºÍ³·Ïú£¬ËùÒÔÑ¡ÔñCÏî¡£ 16. ¼Ì³Ð»úÖƵÄ×÷ÓÃÊÇ£¨£© A. ÐÅÏ¢Òþ²Ø B. Êý¾Ý·â×° C. ¶¨ÒåÐÂÀà D. Êý¾Ý³éÏó ´ð°¸£ºC

½âÎö£ºÃæÏò¶ÔÏóÉè¼ÆÖеÄÀàµÄÌص㣺³éÏó¡¢·â×°¡¢¼Ì³ÐºÍ¶à̬µÈ£¬¼Ì³ÐÓÃÓÚ¶ÔÀàµÄÀ©Õ¹ £¬ËùÒÔÑ¡ÔñCÏî¡£

17. ÒÑÖª£ºpÊÇÒ»¸öÖ¸ÏòÀàAÊý¾Ý³ÉÔ±mµÄÖ¸Õ룬A1ÊÇÀàAµÄÒ»¸ö¶ÔÏó¡£Èç¹ûÒª¸øm¸³ÖµÎª5£¬ÕýÈ· µÄÊÇ£¨£© A. A1.p=5; B. A1->p=5; C. A1.*p=5; D. *A1.p=5; ´ð°¸£ºC

½âÎö£º AÖÐpÊÇÖ¸Õë¼´µØÖ·£¬´íÎó£»BÑ¡ÏîÖÐA1²»ÊÇÖ¸Õë²»ÄÜʹÓÃÖ¸ÏòÔËËã·û->,´íÎó

£»¡°*¡±±È¡°.¡±¼¶±ðÒª¸ß£¬ËùÒÔDÑ¡Ïî*A1.p=5Ï൱ÓÚ(*A1).p=5;´íÎó¡£ÁíÍâÉæ¼°µ½Ö¸Ïò³ÉÔ±º¯Êý ʱעÒâÒÔϼ¸µã£º

Ö¸Ïò³ÉÔ±º¯ÊýµÄÖ¸Õë±ØÐëÓÚÆ丳ֵµÄº¯ÊýÀàÐÍÆ¥ÅäµÄÈý¸ö·½Ã棺(1)²ÎÊýÀàÐͺ͸öÊý£»(2)·µ»Ø ÀàÐÍ£»(3)ËüËùÊôµÄÀàÀàÐÍ¡£

³ÉÔ±º¯ÊýÖ¸ÕëµÄÉùÃ÷£ºÖ¸ÏòshortÐ͵ÄScreenÀàµÄ³ÉÔ±µÄÖ¸Õ붨ÒåÈçÏ£º short Screen::* ps_Screen;

ps_Screen¿ÉÒÔÓÃ_heightµÄµØÖ·³õʼ»¯ÈçÏ£ºshort Screen::*ps_Screen=&Screen::_height; Àà³ÉÔ±µÄÖ¸Õë±ØÐë×ÜÊÇͨ¹ýÌض¨µÄ¶ÔÏó»òÖ¸Ïò¸ÄÀàÐ͵ĶÔÏóµÄÖ¸ÕëÀ´·ÃÎÊ¡£ÊÇͨ¹ýʹÓÃÁ½¸öÖ¸ Ïò³ÉÔ±²Ù×÷·ûµÄÖ¸Õë(Õë¶ÔÀà¶ÔÏóºÍÒýÓõÄ.*£¬ÒÔ¼°Õë¶ÔÖ¸ÏòÀà¶ÔÏóµÄÖ¸ÕëµÄ->*)¡£ 18. Èç¹û²ÉÓö¯Ì¬¶à̬ÐÔ£¬Òªµ÷ÓÃÐ麯ÊýµÄÊÇ£¨£© A. »ùÀà¶ÔÏóÖ¸Õë B. ¶ÔÏóÃû C. »ùÀà¶ÔÏó D. ÅÉÉúÀàÃû ´ð°¸£ºA

½âÎö£º»ùÀàÖ¸Õë»òÕß»ùÀàµÄÒýÓõ÷ÓÃÐ麯Êý¶¼»á²úÉú¶¯Ì¬¶à̬ÐÔ 19. ÈôÓÐÒÔ϶¨Ò壬Ôò˵·¨´íÎóµÄÊÇ£¨£© int a=100,*p=&a;

A. ÉùÃ÷±äÁ¿p£¬ÆäÖÐ*±íʾpÊÇÒ»¸öÖ¸Õë±äÁ¿ B. ±äÁ¿p¾­³õʼ»¯£¬»ñµÃ±äÁ¿aµÄµØÖ· C. ±äÁ¿pÖ»¿ÉÒÔÖ¸ÏòÒ»¸öÕûÐͱäÁ¿ D. ±äÁ¿pµÄֵΪ100 ´ð°¸£ºD

½âÎö£ºÖ¸Õë±äÁ¿ÈçͬÆäËû±äÁ¿Ò»Ñù£¬ÔÚʹÓÃ֮ǰ±ØÐëÏÈÉùÃ÷¡£ÉùÃ÷Ö¸Õë±äÁ¿µÄ¸ñʽΪ£º <ÀàÐÍÃû>*<±äÁ¿Ãû>;

ÆäÖУ¬<ÀàÐÍÃû>ÊÇÖ¸Õë±äÁ¿ËùÖ¸Ïò¶ÔÏóµÄÀàÐÍ£¬Ëü¿ÉÒÔÊÇC++ÓïÑÔÔ¤¶¨ÒåµÄÀàÐÍ£¬Ò²¿ÉÒÔÊÇÓû§ ×Ô¶¨ÒåÀàÐÍ¡£<±äÁ¿Ãû>ÊÇÓû§×Ô¶¨ÒåµÄ±êʶ·û¡£·ûºÅ*±íʾ<±äÁ¿>ÊÇÖ¸Õë±äÁ¿¡£¶ø²»ÊÇÆÕͨ±äÁ¿ ¡£ *±íʾָÕ룬pÊDZäÁ¿£¬pÖ¸ÏòÒ»¸öÕûÐ͵ıäÁ¿£¬ÖµÎªaµÄµØÖ·Öµ£¬*p=100¡£ 20. C++ÓïÑÔ½¨Á¢Àà×åÊÇͨ¹ý£¨£© A. ÀàµÄǶÌ× B. ÀàµÄ¼Ì³Ð C. Ð麯Êý D. ³éÏóÀà ´ð°¸£ºB

½âÎö£ºÀà×弴ͬһ¸öÀàÅÉÉú³öÀ´µÄÀ࣬¸÷¸öÀàÊÇÐֵܻò¸¸×Ó¹Øϵ¡£

¶þ¡¢Ìî¿ÕÌ⣨±¾´óÌâ¹²20СÌ⣬ÿСÌâ1·Ö£¬¹²20·Ö£©ÇëÔÚÿСÌâµÄ¿Õ¸ñÖÐÌîÉÏÕýÈ·´ð °¸¡£´íÌî¡¢²»Ìî¾ùÎÞ·Ö¡£

1. ¼ÙÉèint a=1,b=2;Ôò±í´ïʽ(++a/b)*b--µÄֵΪ___¡£ ´ð°¸£º2

£Û½âÎö£Ýǰ׺£«£«»ò¨D¨D±íʾÏÈʹ±äÁ¿Öµ±ä»¯£¬ÔÙʹÓã¬ÕâºÍºó׺ǡǡÏà·´¡£µ«ÊDZàÒë cout<<(++a/b)*b--ʱ£¬ÏÈ++a/bֵΪ1£¬ºó1*b--£¬ÏÈÈ¡b£½2£¬½á¹ûΪ2£¬ÔÙÈÃb£½1¡£ 2. ¸´Öƹ¹Ô캯ÊýʹÓÃ___×÷ΪÐÎʽ²ÎÊý¡£ ´ð°¸£º¶ÔÏóµÄÒýÓÃ

£Û½âÎö£Ý¸´Öƹ¹Ô캯ÊýʹÓöÔÏóµÄÒýÓÃÀ´³õʼ»¯Ò»¸öжÔÏó,±ÜÃâÁÙʱ²úÉú¶ÔÏó¡£ 3. ͨ¹ýC++ÓïÑÔÖеÄ___»úÖÆ£¬¿ÉÒÔ´ÓÏÖ´æÀàÖй¹½¨Æä×ÓÀà¡£ ´ð°¸£º¼Ì³Ð

£Û½âÎö£Ý¼Ì³Ð¸ÅÄ´ÓÏÖÓеÄÀàÉú³ÉÐÂÀ࣬ԭÓеÄÀà³ÆΪ¸¸Àà»ò»ùÀ࣬ÐÂÀàÓÖ³Æ×ÓÀà»òÅÉÉúÀà»ò ÑÜÉúÀ࣬ËüÊǶԻùÀàµÄÀ©³ä¡£

4. ¾²Ì¬³ÉÔ±º¯Êý¡¢ÓÑÔªº¯Êý¡¢¹¹Ô캯ÊýºÍÎö¹¹º¯ÊýÖУ¬²»ÊôÓÚ³ÉÔ±º¯ÊýµÄÊÇ___¡£ ´ð°¸£ºÓÑÔªº¯Êý

£Û½âÎö£ÝÓÑÔªº¯Êý²»ÊÇÀà³ÉÔ±£¬µ«¿ÉÒÔ·ÃÎÊÀà³ÉÔ±¡£ÀàµÄ·â×°ÐÔ±£Ö¤ÁËÊý¾ÝµÄ°²È«£¬µ«ÒýÈëÓÑÔª £¬ËäÈ»·ÃÎÊÀàÊÇ·½±ãÁË£¬µ«È·ÊµÆÆ»µÀà·ÃÎʵݲȫÐÔ¡£ 5. ÔÚÏÂÃæµÄÀඨÒåÖУ¬Ë½ÓгÉÔ±ÓÐ___¡£ class Location {int X,Y; protected:

int zeroX,zerxY;

int SetZero(intzeroX, intzeroY); private:

int length,height; public:

void init(int initX,int initY); int GetX(); int GetY(); };

´ð°¸£º X,Y,length,height

6. ÔÚC++³ÌÐòÉè¼ÆÖУ¬½¨Á¢¼Ì³Ð¹Øϵµ¹¹ÒµÄÊ÷ӦʹÓÃ___¼Ì³Ð¡£