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

ɾ³ýC/C++×¢ÊÍ

/********************************************************************
*ɾ³ýC/C++×¢ÊÍ
**********************************************************************/
#include <stdio.h>
//×¢Òâ
//1.¶Ô/****/µÄ´¦Àí
//2.Òª±£ÁôË«ÒýºÅÖ®¼äµÄÄÚÈÝ£¬Èçchar* test = "/*i am not comment */";
//3.¶ÔÓÚµ¥ÒýºÅÖеÄÄÚÈÝͬÑù±£Áô(²»¼ì²é³ÌÐòµÄÓï·¨´íÎó)
//4.¶ÔÓÚתÒå×Ö·ûµÄ´¦Àí(¼û״̬6)£¬Èçchar* test = "string\"string too/*i am not comment"
int noComment(FILE *in,FILE *out)
{
    int ch, lastch, state = 0, sq = 0;
    while( ( ch = fgetc(in) ) != EOF )
    {
        switch(state)
        {
        case 0:
            if( ch == '/' )
            {
                lastch = '/' ;
                state = 1 ;
            }
            else
            {
                if( ch == '\'' || ch == '"' )
                {
                    state = 5 ;
                    if( ch == '\'' )
                        sq = 1;
                }
                fputc(ch, out);
      &n


Ïà¹ØÎĵµ£º

Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í

Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í
DelphiÊý¾ÝÀàÐÍC/C++
ShorInt
8λÓзûºÅÕûÊý
char
Byte
8λÎÞ·ûºÅÕûÊý
BYTE,unsigned short
SmallInt
16λÓзûºÅÕûÊý
short
Word
16λÎÞ·ûºÅÕûÊý
unsigned short
Integer,LongInt
32λÓзûºÅÕûÊý
int,long
Cardinal,LongWord/DWORD
32λÎÞ·ûºÅÕûÊý
unsigned long
Int6 ......

¼òÊöCºÍC++³ÌÐòԱѧϰÀú³Ì

    ×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½,ÈçºÎѧϰCºÍC++²Å²»Ã£È»,²Å²»ÊÇÂÒѧ¡£ÏëÁËÒ»ÏÂ,ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
    Ò»¼ÒÖ®ÑÔ,»¶Ó­ÅÄש¹þ¡£
    1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC
    ´ó¶àÊýʱºò,ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ,²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò,¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓ ......

»ªÎªC/C++±ÊÊÔÌâ3

1. ÕÒ´í
#define MAX_SRM 256
DSN get_SRM_no()
{
    static int SRM_no;
    int I;
    for(I=0;I<MAX_SRM;I++,SRM_no++)
    {
        SRM_no %= MAX_SRM;
        ......

linux ÏÂÓÃCʵÏÖ¡®CAT¡¯µÄ¹¦ÄÜ

linux
ÏÂÓÃCʵÏÖ‘CAT’µÄ¹¦ÄÜ
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *file;
char buf[1024],name[20];
int n;
if(argc != 2){
printf("wrong argument\n");
return 1;
}
file=fopen(argv[1],"r");
if(file==NULL){
printf("Cant't open!\n&quo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ