CÊäÈëÊä³ö
×ÛÊö
¿´Ò»ÏÂÊäÈë²Ù×÷µÄÔÀí£¬
³ÌÐòµÄÊäÈ붼½¨ÓÐÒ»¸ö»º³åÇø£¬¼´ÊäÈ뻺³åÇø¡£Ò»´ÎÊäÈë¹ý³ÌÊÇÕâÑùµÄ£¬µ±Ò»´Î¼üÅÌÊäÈë½áÊøʱ»á½«ÊäÈëµÄÊý¾Ý´æÈëÊäÈ뻺³åÇø£¬¶øcinµÈÊäÈëÊä³öº¯ÊýÖ±½Ó´ÓÊä
È뻺³åÇøÖÐÈ¡Êý¾Ý¡£ÕýÒòΪcinµÈÊäÈëÊä³öº¯ÊýÊÇÖ±½Ó´Ó»º³åÇøÈ¡Êý¾ÝµÄ£¬ËùÒÔÓÐʱºòµ±»º³åÇøÖÐÓвÐÁôÊý¾Ýʱ£¬cinº¯Êý»áÖ±½ÓÈ¡µÃÕâЩ²ÐÁôÊý¾Ý¶ø²»»áÇëÇó
¼üÅÌÊäÈë¡£
---------------
µÚÒ»£º
ҪעÒⲻͬµÄº¯ÊýÊÇ·ñ½ÓÊÜ¿Õ¸ñ·û¡¢ÊÇ·ñÉáÆú×îºóµÄ»Ø³µ·ûµÄÎÊÌâ!
¶ÁÈ¡×Ö·ûʱ£º
scanf()ÒÔSpace¿Õ¸ñ¡¢Enter¡¢Tab½áÊøÒ»´ÎÊäÈ룬²»»áÉáÆú×îºóµÄ»Ø³µ·û£¨¼´»Ø³µ·û»á²ÐÁôÔÚ»º³åÇøÖУ©£¬£¨Çø±ð¶Á×Ö·û´®Ê±»áÇå³þ£©//ËùÒÔ¿ÉÒÔÓÃgetchar()Çå³ý£»
getchar()ÒÔEnter½áÊøÊäÈ룬Ҳ²»»áÉáÆú×îºóµÄ»Ø³µ·û£»
¶ÁÈ¡×Ö·û´®Ê±£º
scanf()ÒÔSpace¡¢Enter¡¢Tab½áÊøÒ»´ÎÊäÈ룬»áÉáÆú×îºóµÄ»Ø³µ·û£¨Çø±ð¶Á×Ö·ûʱ£©ºÍËùÓеĿոñµÈµÈ¡£
gets()ÒÔEnter½áÊøÊäÈ루¿Õ¸ñ²»½áÊø£©£¬½ÓÊÜ¿Õ¸ñ£¬»áÉáÆú×îºóµÄ»Ø³µ·û£¡
µÚ¶þ£ºÎªÁ˱ÜÃâ³öÏÖÉÏÊöÎÊÌ⣬±ØÐëÒªÇå¿Õ»º³åÇøµÄ²ÐÁôÊý¾Ý£¬¿ÉÒÔÓÃÒÔϵķ½·¨½â¾ö£º
·½·¨1£ºCÓïÑÔÀïÌṩÁ˺¯ÊýÇå¿Õ»º³åÇø£¬Ö»ÒªÔÚ¶ÁÊý¾Ý֮ǰÏÈÇå¿Õ»º³åÇø¾ÍûÎÊÌâÁË£¡
Õâ¸öº¯ÊýÊÇfflush(stdin)¡£
·½·¨2£º×Ô¼ºÈ¡³ö»º³åÇøÀïµÄ²ÐÁôÊý¾Ý¡£
scanf("%[^\n]",string);
¸ñʽ»¯ÊäÈëÊä³öº¯Êý
Turbo C2.0 ±ê×¼¿âÌṩÁËÁ½¸ö¿ØÖÆ̨¸ñʽ»¯ÊäÈë¡¢ Êä³öº¯Êýprintf( ) ºÍ
scanf(), ÕâÁ½¸öº¯Êý¿ÉÒÔÔÚ±ê×¼ÊäÈëÊä³öÉ豸ÉÏÒÔ¸÷ÖÖ²»Í¬µÄ¸ñʽ¶ÁдÊý¾Ý¡£
printf()º¯ÊýÓÃÀ´Ïò±ê×¼Êä³öÉ豸(ÆÁÄ»)дÊý¾Ý; scanf() º¯ÊýÓÃÀ´´Ó±ê×¼ÊäÈë
É豸(¼üÅÌ)É϶ÁÊý¾Ý¡£ÏÂÃæÏêϸ½éÉÜÕâÁ½¸öº¯ÊýµÄÓ÷¨¡£
Ò»¡¢printf()º¯Êý
printf()º¯ÊýÊǸñʽ»¯Êä³öº¯Êý, Ò»°ãÓÃÓÚÏò±ê×¼Êä³öÉ豸°´¹æ¶¨¸ñʽÊä³ö
ÐÅÏ¢¡£ÔÚ±àд³ÌÐòʱ¾³£»áÓõ½´Ëº¯Êý¡£printf()º¯ÊýµÄµ÷ÓøñʽΪ:
printf("<¸ñʽ»¯×Ö·û´®>", <²ÎÁ¿±í>);
ÆäÖиñʽ»¯×Ö·û´®°üÀ¨Á½²¿·ÖÄÚÈÝ: Ò»²¿·ÖÊÇÕý³£×Ö·û, ÕâЩ×Ö·û½«°´Ô
ÑùÊä³ö; ÁíÒ»²¿·ÖÊǸñʽ»¯¹æ¶¨×Ö·û, ÒÔ"%"¿ªÊ¼, ºó¸úÒ»¸ö»ò¼¸¸ö¹æ¶¨×Ö·û,
ÓÃÀ´È·¶¨Êä³öÄÚÈݸñʽ¡£
²ÎÁ¿±íÊÇÐèÒªÊä³öµÄһϵÁвÎÊý, Æä¸öÊý±ØÐëÓë¸ñʽ»¯×Ö·û´
Ïà¹ØÎĵµ£º
Õû¸ö²âÊÔ×ñÑÒÔϵÄÔ¼¶¨£º
u
¼Ù¶¨ÔÚËùÓеijÌÐòÖбØÐëµÄÍ·Îļþ¶¼ÒѾ±»ÕýÈ·°üº¬¡£
¿¼ÂÇÈçϵÄÊý¾ÝÀàÐÍ£º
u
char
Ϊ
1
¸ö×Ö½Ú
u
int
Ϊ
4
¸ö×Ö½Ú
u
......
£¨×¢£¬±¾ÎÄÊÇ·ÒëµÄhttp://www.cprogramming.com/
ÉϵÄÎÄÕ Where C and C++ Differ
£©
C++»ùÓÚC£¬Ò²±£ÁôÁËCµÄ´ó²¿·ÖÌØÐÔ¡£µ«ÊÇÔÚÔ´Â뼶ÉÏÓÐЩµØ·½ÊÇÓëC²»¼æÈݵġ£
C³ÌÐòԱʹÓÃC++ʱµÄÏÝÚå
´Ó void* µÄÒþʽ·ÖÅä
²»ÄÜ´Ó void* ÒþʽµØ·ÖÅäµ½ÆäËûÈκÎÀàÐÍ¡£ÀýÈ磬ÏÂÃæµÄ´úÂëÔÚCÖÐÊǷdz£ÓÐЧµÄ¡£
in ......
ÒÔÏÂÊǼ¸¸ö¼¬ÊÖµÄ
C ÎÊÌâ, ºÜÄÑ×ö, ¿´¿´×Ô¼º»á×ö¼¸¸ö?
How do you write a program which produces its own source code as its output?
How can I find the day of the week given the date?
Why doesn’t C have nested functions?
What is the most efficient way to count the num ......
http://www.diybl.com/course/3_program/c++/cppjs/20090403/163906.html
CºÍC++»ìºÏ±à³Ì(__cplusplus Óë external "c" µÄʹÓÃ)
www.diybl.com¡¡Ê±¼ä£º2009-04-03¡¡×÷Õß:ÄäÃû ±à¼:sky µã»÷£º¡¡124 [ÆÀÂÛ]
µÚÒ»ÖÖÀí½â
±ÈÈç˵ÄãÓÃC++¿ª·¢ÁËÒ»¸öDLL¿â£¬ÎªÁËÄܹ»ÈÃCÓïÑÔÒ²Äܹ»µ÷ÓÃÄãµÄDLLÊä³ö(Export)µÄº¯Êý£¬ÄãÐèÒªÓÃexte ......
CÓïÑÔÖУº
extern £ºextern£¨ÍⲿÒýÓã©¿ÉÒÔÖÃÓÚ±äÁ¿»òÕߺ¯ÊýÇ°£¬ÒÔ±êʾ±äÁ¿»òº¯ÊýµÄ¶¨ÒåÔÚ±ðµÄÎļþÖУ¬ÔÚÒ»¸öÎļþÖÐÓõ½µÄexternÕâЩ±äÁ¿»òº¯ÊýÊÇÍâÀ´µÄ£¬²»ÊDZ¾Îļþ¶¨ÒåµÄ£¬Ìáʾ±àÒëÆ÷Óöµ½´Ë±äÁ¿ºÍº¯ÊýʱÔÚÆäËûÄ£¿éÖÐÑ°ÕÒÆ䶨Òå¡£×¢Ò⣬ֻÓÐÆäËûÎļþÖеÄÈ«¾Ö±äÁ¿²ÅÄܱ»ÆäËûÎļþËùextern¡£
extern int val;
×¢£º
  ......