C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü£¨×ª£©
1.ÊDz»ÊÇÒ»¸ö¸¸ÀàдÁËÒ»¸övirtual º¯Êý£¬Èç¹û×ÓÀา¸ÇËüµÄº¯Êý²»¼Óvirtual ,Ò²ÄÜʵÏÖ¶à̬?
virtualÐÞÊηû»á±»ÒþÐμ̳еġ£private Ò²±»¼¯³É£¬Ö»ÊÂÅÉÉúÀàûÓзÃÎÊȨÏÞ¶øÒÑ¡£virtual¿É¼Ó¿É²»¼Ó¡£×ÓÀàµÄ¿Õ¼äÀïÓи¸ÀàµÄËùÓбäÁ¿(static³ýÍâ)¡£Í¬Ò»¸öº¯ÊýÖ»´æÔÚÒ»¸öʵÌå(inline³ýÍâ)¡£×ÓÀา¸ÇËüµÄº¯Êý²»¼Óvirtual ,Ò²ÄÜʵÏÖ¶à̬¡£ÔÚ×ÓÀàµÄ¿Õ¼äÀÓи¸ÀàµÄ˽ÓбäÁ¿¡£Ë½ÓбäÁ¿²»ÄÜÖ±½Ó·ÃÎÊ¡£
--------------------------------------------------------------------------
2.ÊäÈëÒ»¸ö×Ö·û´®£¬½«ÆäÄæÐòºóÊä³ö¡££¨Ê¹ÓÃC++£¬²»½¨ÒéÓÃαÂ룩
#include <iostream>
using namespace std;
void main()
{
char a[50];memset(a,0,sizeof(a));
int i=0,j;
char t;
cin.getline(a,50,'\n');
for(i=0,j=strlen(a)-1;i<strlen(a)/2;i++,j--)
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
cout<<a<<endl;
}
//µÚ¶þÖÖ
string str;
cin>>str;
str.replace;
cout<<str;
--------------------------------------------------------------------------
3.Çë¼òµ¥ÃèÊöWindowsÄÚ´æ¹ÜÀíµÄ·½·¨¡£
ÄÚ´æ¹ÜÀíÊDzÙ×÷ϵͳÖеÄÖØÒª²¿·Ö£¬Á½Èý¾ä»°¿ÖÅÂËҲ˵²»Çå³þ°É¡«¡«
ÎÒÏÈ˵¸ö´ó¸Å£¬Ï£ÍûÄܹ»Å×שÒýÓñ°É
µ±³ÌÐòÔËÐÐʱÐèÒª´ÓÄÚ´æÖжÁ³öÕâ¶Î³ÌÐòµÄ´úÂë¡£´úÂëµÄλÖñØÐëÔÚÎïÀíÄÚ´æÖвÅÄܱ»ÔËÐУ¬ÓÉÓÚÏÖÔڵIJÙ×÷ϵͳÖÐÓзdz£¶àµÄ³ÌÐòÔËÐÐ×Å£¬ÄÚ´æÖв»Äܹ»ÍêÈ«·ÅÏ£¬ËùÒÔÒý³öÁËÐéÄâÄÚ´æµÄ¸ÅÄî¡£°ÑÄÄЩ²»³£ÓõijÌÐòƬ¶Ï¾Í·ÅÈëÐéÄâÄڴ棬µ±ÐèÒªÓõ½ËüµÄʱºòÔÚloadÈëÖ÷´æ£¨ÎïÀíÄڴ棩ÖС£Õâ¸ö¾ÍÊÇÄÚ´æ¹ÜÀíËùÒª×öµÄÊ¡£ÄÚ´æ¹ÜÀí»¹ÓÐÁíÍâÒ»¼þÊÂÐèÒª×ö£º¼ÆËã³ÌÐòƬ¶ÎÔÚÖ÷´æÖеÄÎïÀíλÖã¬ÒÔ±ãCPUµ÷¶È¡£
ÄÚ´æ¹ÜÀíÓпéʽ¹ÜÀí£¬Ò³Ê½¹ÜÀí£¬¶ÎʽºÍ¶Îҳʽ¹ÜÀí¡£ÏÖÔÚ³£ÓöÎҳʽ¹ÜÀí
¿éʽ¹ÜÀí£º°ÑÖ÷´æ·ÖΪһ´ó¿é¡¢Ò»´ó¿éµÄ£¬µ±ËùÐèµÄ³ÌÐòƬ¶Ï²»ÔÚÖ÷´æʱ¾Í·ÖÅäÒ»¿éÖ÷´æ¿Õ¼ä£¬°Ñ³Ì ÐòƬ¶ÏloadÈëÖ÷´æ£¬¾ÍËãËùÐèµÄ³ÌÐòƬ¶ÈÖ»Óм¸¸ö×Ö½ÚÒ²Ö»ÄÜ°ÑÕâÒ»¿é·ÖÅä¸øËü¡£ÕâÑù»áÔì³ÉºÜ´óµÄÀË·Ñ£¬Æ½¾ùÀË·ÑÁË50£¥µÄÄÚ´æ¿Õ¼ä£¬µ«Ê±Ò×ÓÚ¹ÜÀí¡£
ҳʽ¹ÜÀí£º°ÑÖ÷´æ·ÖΪһҳһҳµÄ£¬Ã¿Ò»Ò³µÄ¿Õ¼äÒª±ÈÒ»¿éÒ»¿éµÄ¿Õ¼äСºÜ¶à£¬ÏÔÈ»ÕâÖÖ·½·¨µÄ¿Õ¼äÀûÓÃÂÊÒª±È¿éʽ¹ÜÀí¸ßºÜ¶à¡£
¶Îʽ¹ÜÀí£º°ÑÖ÷´æ·ÖΪһ¶ÎÒ»¶ÎµÄ£¬Ã¿Ò»¶ÎµÄ¿Õ¼äÓÖÒª±
Ïà¹ØÎĵµ£º
#include <stdio.h>
#include <string.h>
int
main(void)
{
char str[] =
"3BVPSq4xF.K?=u#,"
"G'K<MrDnRr7gH%#,"
"XKf<f%G`w^=?C<#,"
"HgU_AnNR?*PDQU#,"
......
#include <stdio.h>
#include <string.h>
int
main(void)
{
char str[] =
"3BVPSq4xF.K?=u#,"
"G'K<MrDnRr7gH%#,"
"XKf<f%G`w^=?C<#,"
"HgU_AnNR?*PDQU#,"
......
#include <stdio.h>
#include <string.h>
int
main(void)
{
char str[] =
"3BVPSq4xF.K?=u#,"
"G'K<MrDnRr7gH%#,"
"XKf<f%G`w^=?C<#,"
"HgU_AnNR?*PDQU#,"
......
ÔÚÉÏһƪÖÐÎÒÃÇÒѾʹÓÃcÓïÑÔʵÏÖÁËÒ»¸ö×î¼òµ¥µÄÀ©Õ¹Ä£¿é£¬ÕâһƪÖн«ÔÚÆä»ù´¡ÉϽøÐй¦Äܵķḻ¡£Ê×ÏÈÀ´¿¼ÂÇÈçºÎ´ÓÍⲿµÄPythonÏòCÄ£¿é´«µÝ½ø²ÎÊý£¬foo_bar2չʾÁËÈçºÎÏòCÄ£¿é´«µÝÕûÊý£¬¸¡µãÊý£¬×Ö·û´®Èý¸ö²ÎÊý£¬ÆäÖÐ"ids"Ö¸Ã÷ÁË´«Èë²ÎÊýµÄÊý¾ÝÀàÐÍ¡£PyArg_ParseTuple¸ºÔð¶Ôargs½øÐнâÎö£¬Èô½âÎöʧ°ÜÔò·µ»Ø0.´úÂë#include&n ......
Óë &£º ÈκÎλÓÃ&ÔËËãÓë0½áºÏ½á¹ûΪ0£¬Óë1½áºÏ½á¹ûΪÆä±¾Éí£»
»ò | £º ÈκÎλÓÃ|ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏ½á¹ûΪ1£»
Òì»ò ^ £º ÈκÎλÓÃ^ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏÔòÈ¡·´£» ......