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

cµÄÒ»¸öСÎÊÌâ

/*±àд³ÌÐò£¬ÊäÈë2¸öÊýÒÔ¼°¼Ó¼õ³Ë³ýÖеÄijÔËËã·ûºÅ£¬²¢µ÷ÓÃ×Ô¼º±àдµÄº¯Êý¼ÆËãÏàÓ¦µÄ½á¹û*/
#include<stdio.h>
#include<conio.h>
float cal(int a,char sym,int b);
main()
{
 int a=0,b=0;
 char sym='\0';
 float c=0.0;
 scanf("%d%c%d",&a,&sym,&b);
 c=cal(a,sym,b);
 printf("%d%c%d=%f\n",a,sym,b);
 getch();
}
float cal(int a,char sym,int b)
{
      float c=0.0;
      switch(sym)
      {
                 case '+': c=a+b;
                 case '-': c=a-b;
                 case '*': c=a*b;
                 case '/': if(b!=0)
                 {
                      c=(float)a/b;
                      return c;
                 }
                 else
                 {
                     printf("Devided by 0.\n");
                  exit(0);  /*±àÒëµÄʱºòÔÚÕâÐгö´í*/
     &n


Ïà¹ØÎĵµ£º

C#¶¯Ì¬µ÷ÓÃC++±àдµÄDLLº¯Êý


¶¯Ì¬¼ÓÔØDLLÐèҪʹÓÃWindows APIº¯Êý£ºLoadLibrary¡¢GetProcAddressÒÔ¼°FreeLibrary¡£ÎÒÃÇ¿ÉÒÔʹÓÃDllImportÔÚC#ÖÐʹÓÃÕâÈý¸öº¯Êý¡£

[DllImport("Kernel32")]
public static extern int GetProcAddress(int handle, String funcname);

[DllImport("Kernel32")]
public static extern int L ......

c£¬c++·ç¸ñ×Ö´®Óëstrcmp

ÖÚËùÖÜÖª£¬strcmpΪ×Ö´®±È½ÏÖ»Ó㬼òµ¥µÄº¯Êý²¢²»¼òµ¥¡£
ÏÂÃæµÄ´úÂë
int main()
{
      char* cp1 = {'z', 'h', 'a', 'n', 'g'};
      char* cp2 = {'z', 'h', 'a', 'n', 'g'};
      std::cout<<strcmp(cp1, cp2)<< ......

C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©

C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;

char * strcpy(char * dest,const char *src)
{
char *tmp = dest;

while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}

char * strncpy(char * des ......

[ת] C/C++ STL֮remove

http://www.cppreference.com/wiki/cn/stl/algorithm/remove
Óï·¨:
#include <algorithm>
forward_iterator remove( forward_iterator start, forward_iterator end, const TYPE& val );
remove Ëã·¨ÒÆ³ý [start,end) ·¶Î§Ö®ÄÚµÄËùÓÐÓë val ÏàµÈµÄÔªËØ¡£
´Ëº¯ÊýµÄ·µ»ØÖµÊÇÒ»¸öµ ......

C/C++Í·ÎļþÒ»ÀÀ

C¡¢´«Í³ C++
#include <assert.h>¡¡¡¡¡¡¡¡//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àí
#include <errno.h>¡¡¡¡¡¡¡¡ //¶¨Òå´íÎóÂë
#include <float.h>¡¡¡¡¡¡¡¡ //¸¡µãÊý´¦Àí
#include <fstream.h>¡¡¡¡¡¡ //ÎļþÊäÈ룯Êä³ö
#include <iomanip.h>¡¡¡¡¡¡ //²ÎÊý»¯ÊäÈ룯Êä³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ