Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

cÊäÈëÊä³ö


¸ñʽÊä³ö:
printf(¸ñʽ¿ØÖÆ, Êä³ö±íÁÐ);
%d Ê®½øÖÆÊý  %md mΪָ¶¨µÄ¿í¶È ÈôÊý¾ÝλÊýСÓÚm,Ôò×ó¶Ë²¹ÒÔ¿Õ¸ñ;Èô´óÓÚm,Ôò°´Êµ¼ÊλÊýÊä³ö
%ld ³¤ÕûÐÍÊý¾Ý  %mld Ö¸¶¨×ֶοí¶È
%o °Ë½øÖÆÕûÊýÐÎʽ  %mo
%x Ê®Áù½øÖÆÕûÊýÐÎʽ  %mx
%u unsignedÐÍÊý¾Ý,ËüÒ²¿ÉÓÃ%o»ò%x¸ñʽÊä³ö
%c Ò»¸ö×Ö·û   %mc
%s ×Ö·û´® Óм¸ÖÖÓ÷¨
 1.%s
   printf("%s", "China");
   Êä³ö China
 2.%ms ¿ØÖÆΪmÁÐ Èô´®³¤Ð¡ÓÚm, Ôò×󲹿ոñ,´óÓÚÔòÍ»ÆÆmÏÞÖÆ,½«×Ö·û´®ÍêÈ«Êä³ö
 3.%-ms Èô´®³¤Ð¡ÓÚm, ÔòÓÒ²¹¿Õ¸ñ(¾Ó×ó)
 4.%m.ns Êä³öÕ¼mÁÐ,È¡×Ö·û´®×ó¶Ën¸ö×Ö·û.Õân¸ö×Ö·ûÊä³öÔÚmÁеÄÓÒ²à,×󲹿ոñ
 5.%-m.ns m.nͬÉÏ,Õân¸ö×Ö·ûÊä³öÔÚmÁеÄ×ó²à,ÓÒ²¹¿Õ¸ñ.Èôn>m,Ôòm×Ô¶¯È¡nÖµ,±£Ö¤n¸ö×Ö·ûÕý³£Êä³ö
%f Êä³öʵÊý(°üÀ¨µ¥.Ë«¾«¶È),ÒÔСÊýÐÎʽÊä³ö
 1.%f Êä³öÈ«²¿ÕûÊý²¿·Ö,Êä³ö6λСÊý
 2.%m.nf Ö¸¶¨Êä³öµÄÊý¾Ý¹²Õ¼mÁÐ,ÆäÖÐÓÐnλСÊý.ÈôÊýÖµ³¤¶ÈСÓÚm,Ôò×ó¶Ë²¹¿Õ¸ñ
 3.%-m.nf Ö¸¶¨Êä³öµÄÊý¾Ý¹²Õ¼mÁÐ,ÆäÖÐÓÐnλСÊý.ÈôÊýÖµ³¤¶ÈСÓÚm,ÔòÓҶ˲¹¿Õ¸ñ
%e ÒÔÖ¸ÊýÐÎʽÊä³öʵÊý
 1.%e ²»Ö¸¶¨Êä³öÊý¾ÝËùÕ¼µÄ¿í¶ÈºÍÊý×Ö²¿·ÖµÄСÊýÊýλ,ÊýÖµ°´¹æ·¶»¯Êä³ö
 2.%m.ne ºÍ %-m.ne Êä³öÕ¼mÁÐ,nÖ¸Êä³öµÄÊý¾ÝµÄСÊý²¿·Ö(βÊý)µÄСÊýÊýλ,-ͬÉÏ
%g Êä³öʵÊý,¸ù¾ÝÊýÖµ´óС,×Ô¶¯Ñ¡Ôñf¸ñʽ»òÕße¸ñʽ(Ñ¡ÔñÊä³ö¿í¶ÈСµÄ),ÇÒ²»Êä³öÎÞÒâÒåµÄÁã
¸ñʽ¿ØÖÆÖпÉÒÔ°üº¬×ªÒå×Ö·û,Èç'\n' '\t' '\b' '\r'
Êä³ö%µÄ·½·¨ printf("%f%%", 1.0/3) Êä³ö: 0.333333%
¸ñʽÊäÈë
scanf(¸ñʽ¿ØÖÆ, µØÖ·±íÁÐ) sscanf
ÀàËÆprintf .ÒÔÀý³Ì½âÊÍ
1. scanf("%3d%3d", &a, &b); //ÁÐÊý½ØÈ¡Êý¾Ý
   input -> 123456
   then -> a = 123  b = 456
2. scanf("%2d %*3d %2d", &a, &b) //*±íʾÌø¹ýÁÐÊý¶ÁÈ¡Êý¾Ý
   input -> 12 345 67
   then -> a = 12 b = 67
3. scanf("%d, %d", &a, &b)
   input -> 1, 4  //ÔÚ¸ñʽ¿ØÖÆÖÐ,Èç¹ûÓзǸñʽ˵Ã÷ÍâµÄ×Ö·û,Ó¦¸ÃÔÚÊäÈëʱÔÚ¶ÔӦλÖÃÊäÈë¸Ã×Ö·û
   scanf("%d   %d", &a, &b)  //ÊäÈëʱ,Á½Êý¾ÝÓ¦Óв»ÉÙÓÚ¸ñʽ¿ØÖÆÖеĿոñ
   scanf(&quo


Ïà¹ØÎĵµ£º

extern "C"

CºÍC++»¥Ïàµ÷Óú¯Êýʱ£¬Ê¹ÓÃextern "C"¡£
Ô­Òò£º
C²»Ö§³Öº¯ÊýÖØÔØ£¬¶øC++Ö§³Öº¯ÊýÖØÔØ¡£º¯Êý±»C++±àÒëºó»áÃû×ÖÓëCÓïÑÔ²»Í¬¡£¼ÙÉèijº¯ÊýÔ­ÐÍΪfoo(ing x, int y)£¬±»C++±àÒëºóÃû×ÖΪ_foo_int_int£¬¶øC±àÒëÆ÷±àÒëºóÃû×ÖΪ_foo¡£ ......

ÓÃC££¡¢JAVAÒ»´ÎÐÔÈ¡³ö´æ´¢¹ý³ÌÖеĸ÷ÖÖ·µ»ØÖµ

ÎÊÌ⣺ÔÚ´æ´¢¹ý³ÌÖУ¬ÓÐʱ»áÓöµ½±È½Ï±ä̬µÄ¶«Î÷£¬ÈçÒ»¸ö´æ´¢¹ý³ÌÖÐÓÐoutput·µ»ØÖµ£¬ÓÐreturn·µ»ØÖµ£¬»¹ÓвéѯµÄ·µ»ØÖµTABLE£¬Óöµ½ÕâÑùµÄ´æ´¢¹ý³ÌÕæÊÇÓôÃÆ£¬Ò»´ÎÐÔ°ÑËùÓеķµ»Øֵȡ³öÀ´»¹ÕæµÄÓеãÂé·³¡£
 
 
1¡¢  Ê×ÏÈÀ´¿´Õâ¸ö´æ´¢¹ý³Ì°É
 
CREATE  PROCEDURE ParaTest
@paraout varchar(20) ......

c ÓïÑÔÖдøconst µÄÖ¸ÕëС¼Ç

Ò»¡¢ÓÐÈçÏ´úÂ룺
int age = 25;
const int *pAge = &age;

ÉÏÃæµÄ´úÂë±íʾ£º
1¡¢Ö¸Õë±äÁ¿pAge´æ·Å±äÁ¿ageµÄµØÖ·£¬ÇÒ²»ÄÜͨ¹ý *pAge = 30£¬À´¸Ä±äÖ¸Õë±äÁ¿pAgeËùÖ¸ÏòµÄ´æ´¢¿Õ¼äµÄÖµ£¬µ«ÊÇ ¶ÔÓÚ age = 30£¬ÔòÊÇûÓÐÎÊÌâµÄ¡£
2¡¢pAge ±¾Éí¿ÉÒÔÔÙ´æ·ÅÆäËü±äÁ¿µÄµØÖ·£¬Ò²¿ÉÒÔÖ¸ÏòNULL£¬Èç pAge = NULL;ÊÇÕýÈ·µÄ¡£
¶ ......

ÈçºÎÀí½âcºÍc++ µÄ¸´ÔÓÀàÐÍÉùÃ÷

Ôø¾­Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷¡£
¡¡¡¡ÎÒÃǽ«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò”¡£ ......

C³ÌÐòʹÓò»Í¬º¯Êýµ÷ÓÃÔ¼¶¨µ÷Óûã±à×Ó¹ý³Ì

ÈçתÔØ£¬Çë×¢Ã÷³ö´¦£ºhttp://blog.csdn.net/zhangyang0402/archive/2010/05/01/5549266.aspx
 
¿ª·¢¹¤¾ß£ºVC ++ 6.0  MASM32
 
Ò»¡¢__cdeclµ÷Ó÷½Ê½
 
1£®  ÔÚVCÖÐн¨Win32 Console Application, TestASM
 
2£®  н¨test.c
#include<stdio.h>
extern void swap(int * ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ