如何把c++ qt的这段代码转换成c++ mfc的 [问题点数:20分,无满意结帖,结帖人fengyw123]

Bbs1
本版专家分:0
结帖率 100%
Bbs1
本版专家分:0
Bbs2
本版专家分:242
Bbs1
本版专家分:0
Bbs2
本版专家分:242
大神帮我把这段C代码转换成汇编语言。
rn朋友正好有这个作业,奈何我不懂C和汇编语言。请各位帮帮忙,最好写上注解,功能要一样,我要和电路图连起来的[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/5.gif][/img]rnrn[img=https://img-bbs.csdn.net/upload/201512/03/1449120980_18164.jpg][/img]rnrn[img=https://img-bbs.csdn.net/upload/201512/03/1449120914_169027.jpg][/img]rnrn[img=https://img-bbs.csdn.net/upload/201512/03/1449120832_311571.jpg][/img]rnrn[code=c]rn#includernsbit DQ = P3^0;rnunsigned char coderntab[] = 0xc0,0xf9,0xa4,0xb0,0x92,0x82,0xf8,0x80,0x90;rnvoid delay(int i)rn rn while(i--);rn rnrnvoid tdelay(int useconds) rnrnint s;rnfor(s=0;s>i;rntemp&=0x01;rnwrite_bit(temp);rnrntdelay(5);rnrnunsigned char read_bit(void)rnunsigned char i;rnDQ=0;rnDQ=1;rnfor(i=0;i>4;rnrnvoid main(void)rnunsigned char temp,bw,sw,gw,tempd;rnwhile(1)rntemp=read_temperature();rnbw=temp/100;rntempd=temp%10;rnif(225>temp>=0)rnrn P2=0x01;rn P0=tab[bw];rn delay(1000);rn P2=0x00;rn P2=0x02;rn P0=tab[sw];rn delay(1000);rn P2=0x00;rn P2=0x04;rn P0=tab[sw];rn delay(1000);rn P2=0x00;rn P2=0x08;rn P0=0xc6;rn delay(1000);rn P2=0x00;rnrn if(temp>=40)rn rn P1=0xff;rnrnelsernrn P1=0x00;rn rn[/code]
请帮忙把这段C代码转换成Delphi,非常感谢!
unsigned short crc_calculate_crc(unsigned short initial_crc, unsigned char *buffer, unsigned short length)rnrn unsigned short index= 0;rn unsigned short crc = initial_crc;rn if(buffer!=NULL)rn rn for(index = 0; index>8)|(unsigned short)(crc<>4;rn crc^=(unsigned short)((unsigned short)(crc<<<<<1);rn rn rn return (crc);rn
这段C代码如何转换成C#代码
C<em>代码</em>:rn....rnstruct meterhdr /* Meter header format */rn unsigned long rx_bytes; /* Received bytes(increment) */rn unsigned long tx_bytes; /* Transmitted bytes(increment) */rn unsigned long rx_packets; /* Received packets(increment) */rn unsigned long tx_packets; /* Transmitted packets(increment) */rn;rn..........................rncbBytesRead = recvfrom(listenSocket,(char *)chRequest,BUFSIZE,0,(struct sockaddr *)&saCaller,&nLen);rn.........................rnmeterHdr = (struct meterhdr *)chRequest;rnrnrn---------------------------------rn我的问题是C#中<em>如何</em>把读到的buffer chRequest 强制<em>转换成</em>(struct meterhdr *)。不是很明白。谢谢!!!!rn
如何这段VB.net转换成 C#代码
rn
帮忙把这段C代码转成VB的
#include rn#include rn#include rn#include "iphlpapi.h"rnrn#pragma comment ( lib, "ws2_32.lib" )rn#pragma comment ( lib, "Iphlpapi.lib" )rnrnvoid main( int argc, char ** argv )rnrnint numberOfHost = 1;rnstruct hostent *remoteHostent;rnrnrnif ( argc == 3 )rnnumberOfHost = atoi( argv[2] );rnif ( ( argc >3 ) || ( argc < 2 ) )rnrnprintf( "RmtHost v0.2 - Get remote HostName /MacAddress\n" );rnprintf( "by ShotgunLabs ( Shotgun@xici.net )\n\n" );rnprintf( "Usage :\n\tRmtHost.exe [RemoteIP]\n\n" );rnprintf( "Example:\n\tRmtHost.exe 192.168.0.3\n" );rnprintf( "\tRmtHost.exe 192.168.0.3 255\n\n" );rnexit( 0 );rnrnrnWSADATA wsaData;rnint iRet = WSAStartup(MAKEWORD(2,1), &wsaData);rnif ( iRet != 0 )rnrnprintf( "WSAStartup Error:%d\n", GetLastError() );rnexit( 0 );rnrnint nRemoteAddr = inet_addr( argv[1] );rnremoteHostent= (struct hostent*)malloc( sizeof(struct hostent ));rnstruct in_addr sa;rnfor ( int i = 0; i < numberOfHost; i ++ )rnrnrnsa.s_addr = nRemoteAddr;rnprintf( "\nIpAddress : %s\n", inet_ntoa( sa ) );rnremoteHostent = gethostbyaddr( (char*)&nRemoteAddr,4, AF_INET );rnif ( remoteHostent )rnprintf( "HostName : %s\n",remoteHostent->h_name );rnelsernprintf( "gethostbyaddr Error:%d\n",GetLastError() );rnrnrnunsigned char macAddress[6];rnULONG macAddLen = 6;rniRet=SendARP(nRemoteAddr, (unsigned long)NULL,(PULONG)&macAddress, &macAddLen);rnif ( iRet == NO_ERROR )rnrnprintf( "MacAddress: " );rnfor( int i =0; i, GetLastError());rnnRemoteAddr = htonl( ntohl( nRemoteAddr ) + 1 );rnrn
求助 把3D模型转换成C代码
各位大虾, 我这里用3DS MAX设计了3D的模型, 我要把这个3D模型<em>转换成</em>相应的C<em>代码</em>,然后用OPENGL描述这个3D的模型.请教<em>如何</em>转换呀? 请各位高手指点. 另外,我听说3DS2C这个工具可以把3D模型转成C<em>代码</em>. 不知道有哪几个软件可以实现这个转换功能,哪位有相关的软件发给小弟一份,并简单说明一下<em>如何</em>使用? 小弟在此感谢了.rnrnEMAIL: lheart@263.com QQ: 18486598
这段C代码如何改为C#代码
[code=C/C++]rn// 获取MAC地址函数rnbool getMACaddr(const char *IP, char *strMAC)rn rn HRESULT hr;rn IPAddr ipAddr;rn ULONG pulMac[ 2 ];rn ULONG ulLen;rn char *tmp0 = new char[50];rn char *tmp1 = new char[50];rn memset(tmp0,0,50);rn memset(tmp1,0,50); rnrn char temp[]="ffffffffffff";rn strcpy(strMAC,temp);rn ipAddr = inet_addr(IP);rn memset( pulMac,0xff,sizeof( pulMac ) );rn ulLen = 6; rn hr = SendARP( ipAddr,0,pulMac,&ulLen );rn if( NO_ERROR != hr || ulLen == 0 ) // Cannot get MAC address.rn rn return false;rn rn rn ULONG i;rn char * szMac = new char[ ulLen * 3 ];rn PBYTE pbHexMac = ( PBYTE )pulMac;rnrn for( i = 0; i < ulLen - 1; ++ i ) rn rn sprintf(tmp0, "%02x",pbHexMac[i]); rn strcat(tmp1,tmp0); rn rn sprintf(tmp0,"%02x",pbHexMac[i]);rn strcat(tmp1,tmp0);rn strcpy(strMAC,tmp1); rnrn delete [] szMac;rn delete [] tmp0;rn delete [] tmp1;rn rn return true;rn[/code]rnrn[code=C/C++]rn// 获取IP/MACrn#define MAX_BUF 4096rn#define LOCATION "Location:"rnrnunsigned int quiet = 0;rnchar ip[16];rnrnint EnumDeviceList(int dimLen, int dimCount, int *ncount, char *addr, char *perr)rnrn int iRet = 0; rn char *err = new char[100];rn memset(err,0,100);rn perr = err; rnrn int sock, ret, one = 1, len;rn struct sockaddr_in cliaddr, destaddr;rn hostent *hostinfo;rn struct timeval tv;rn char buffer[MAX_BUF] = "test data";rn char *token;rn int count = 0;rnrn char *arr[600];rn *ncount = 0;rn char *cliMac = new char[30];rn memset(cliMac,0,30);rnrn WORD sockVersion;rn WSADATA wsaData;rn int rVal; rn sockVersion = MAKEWORD(1,1);rn //start dllrn WSAStartup(sockVersion, &wsaData); rn /* Create socket */rn sock = socket(AF_INET,SOCK_DGRAM , 0); rn if (INVALID_SOCKET == sock) rn rn sprintf(perr,"Cannot open socket [%d]\n", WSAGetLastError());rn WSACleanup();rn perr = err;rn return iRet;rn rnrn /* Allow broadcast on the socket */rn ret = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char FAR *)&one, sizeof(one));rn if (ret < 0) rn rn sprintf(perr,"Cannot prepare socket for broadcast\n");rn WSACleanup();rn perr = err;rn return iRet;rn rnrn /* Set receive timeout */rn tv.tv_sec = 30; rn ret = setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval));rn if (ret < 0) rn rn sprintf(perr,"Cannot set time-out to the socket\n");rn WSACleanup();rn perr = err;rn return iRet;rn rnrn /* bind ipaddr:port */rn cliaddr.sin_family = AF_INET;rn if (strlen(ip) > 0)rn cliaddr.sin_addr.s_addr = inet_addr(ip);rn elsern cliaddr.sin_addr.s_addr = htonl(INADDR_ANY);rn cliaddr.sin_port = htons(0);rn rn // printf("Client Address:%s; Port: %d\r\n",inet_ntoa(cliaddr.sin_addr),cliaddr.sin_port);rnrn ret = bind(sock, (struct sockaddr *)&cliaddr, sizeof(cliaddr));rn if (ret < 0) rn rn sprintf(perr,"Cannot bind port\n");rn WSACleanup();rn perr = err;rn return iRet;rn rnrn /* Set destination for broadcast address */rn destaddr.sin_family = AF_INET;rn destaddr.sin_addr.s_addr = INADDR_BROADCAST;rn destaddr.sin_port = htons(3700);rnrn /* Send the broadcast packet */rn len = strlen(buffer);rn ret = sendto(sock, buffer, len, 0, (struct sockaddr *)&destaddr, sizeof(destaddr));rn if (ret < 0) rn rn sprintf(perr,"Cannot send data\n");rn WSACleanup();rn perr = err;rn return iRet;rn rnrn /* quiet the noise */rn if (quiet == 0)rn printf("Sent broadcast request and now waiting for a response..\n");rnrn while (1) rn rn /* Wait for response */rn len = sizeof(destaddr);rn ret = recvfrom(sock, buffer, MAX_BUF, 0, (struct sockaddr *)&destaddr, &len);rn rn if (ret == -1) /* time out */rn break;rn count++; /* Valid response */rnrn /* Parse the response */rn token = strtok(buffer, "\r\n");rn while (token != NULL) rn rn if (!strncmp(token, LOCATION, strlen(LOCATION)))rn rn sprintf(perr,"Found a device: %s\n", token + strlen(LOCATION)); rn break;rn rn token = strtok(NULL, "\r\n");rn rnrn getMACaddr(inet_ntoa(destaddr.sin_addr),cliMac);rn sprintf( addr+(iCount-1)*dimCount,"%s-%s",inet_ntoa(destaddr.sin_addr),cliMac);rn rn int iCount = count;rnrn if (count>0)rn rn iRet = 1;rn *ncount = count;rn rn elsern rn iRet = 0;rn *ncount = 0;rn rn return iRet;rnrnrn[/code]
C的代码转换成delphi代码
C的<em>代码</em><em>转换成</em>delphi<em>代码</em> rn是一段C 取句柄的<em>代码</em>。帮忙翻译成delphi 的。。。感激不尽 rnrnvoid __stdcall CrnGetStatusBarItem(HANDLE hStatusBar, TStrings *pList) rn rn DWORD dwProcessID; rn HANDLE hProcess; rn LPVOID lpCommon; rn int nAllocSize = 255; rn int nPnlLen; rn char szBuf[255]; rn DWORD dwBytesRead; rn int nPnlCount = SendMessage(hStatusBar, SB_GETPARTS, 0, 0); rn pList->Add("StatusBar的项目数: " + String(nPnlCount)); rnrn GetWindowThreadProcessId(hStatusBar, &dwProcessID); rn hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | rn PROCESS_VM_WRITE, false, dwProcessID); rn lpCommon = VirtualAllocEx(hProcess, NULL, nAllocSize, rn MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); rnrn for(int i=0; iAdd(szBuf); rn rn VirtualFreeEx(hProcess, lpCommon, 0, MEM_RELEASE); rn CloseHandle(hProcess); rn rn
C代码转换成Delphi代码
std::vectorrnChanlunTools::Ema(std::vector &X, int N)rnrn std::vector vec;rn int nLen = X.size();rn if(nLen >= 1)rn rn if(N > nLen) N = nLen;rn rn vec.resize(nLen);rn //vec.reserve(nLen);rn vec[0] = X[0];rn for(int i = 1; i < nLen; i++)rn rn vec[i] = (2 * X[i] + (N - 1) * vec[i - 1]) / (N + 1);rn rn rn return vec;rn
如何把\Device\HarddiskVolume1转换成C:
据我所知 QueryDosDevice 可以把 C: 转化为\Device\HarddiskVolume1, rn那么我们该<em>如何</em>把 \Device\HarddiskVolume1转化为 C:呢...
用gcc如何把C转换成汇编?
我编程环境是UltraEdit-32,Xshell,Fedora.7.linuxrn用gcc编译,我是初学者。但是不知道怎么把C全部<em>转换成</em>汇编语言rn查看了gcc里面的帮助。但是我不知道怎么执行rn有没有高手知道该怎么在gcc里面输命令;假设我写成的C语言文件为:hello.crn然后命令该怎么执行呢?才让我看到 hello.c全部变为汇编语言rn求解。。。
如何把\\Device\\HarddiskVolumeX转换成C:
我是一个vc盲
如何这段VC代码转换成C++bulider代码?
void CFullScreen::OnPaint() rnrnrn CPaintDC dc(this); // device context for paintingrn CBrush* pbsOld;rn CBrush bsCyan;rn CRgn rgn;rn //create a cran brushrn bsCyan.CreateSolidBrush(RGB(255,0,255));rn pbsOld=(CBrush*)dc.SelectObject(bsCyan);rn RECT DispRect;rn DispRect.left=0;rn DispRect.top=0;rn DispRect.right=GetSystemMetrics(SM_CXSCREEN);rn DispRect.bottom=GetSystemMetrics(SM_CYSCREEN);rn ScreenToClient(&DispRect);rn rgn.CreateRectRgn(DispRect.left,DispRect.top,DispRect.right,DispRect.bottom); rn dc.PaintRgn(&rgn);rn rgn.DeleteObject();rn // Do not call CDialog::OnPaint() for painting messagesrn
如何这段DELPHI代码转换成C++ Builder 5.0的代码?
请问<em>如何</em>把<em>这段</em>DELPHI<em>代码</em><em>转换成</em>C++ Builder 5.0的<em>代码</em>?rnrn不胜感激!rnrn****************************rn* 以下为窗口效果相关过程 *rn****************************rnrn//限制窗口的Top不能小于0,即窗口不能被拖动到顶部以外rnrnprocedure TfrmMain.WMMOVING(var Msg: TMessage);rnbeginrn inherited;rn //当窗口被移动的时候rn if PRECT(Msg.lParam).Top < 0 thenrn PRECT(Msg.lParam).Top := 0;rnend;rnrn//实现窗口自动弹出rnrnprocedure TfrmMain.MouseEnterProc(var Msg: TMessage);rnbeginrn inherited;rnrn tmrMouseOut.Enabled := True;rn //如果窗口不是隐藏的,不用弹出。rn if Self.Top >= 0 thenrn Exit;rn Self.Top := 0;rn Msg.Result := 0;rnend;rnrn//实现窗口自动隐藏rnrnprocedure TfrmMain.MouseLeaveProc(Sender: TObject);rnvarrn pt: TPoint;rnbeginrn GetCursorPos(pt);rn if (not PtInRect(Self.BoundsRect, pt)) and (GetAsyncKeyState(VK_LButton) <> 0) thenrn Exit;rn if PtInRect(Self.BoundsRect, pt) thenrn Exit;rnrn tmrMouseOut.Enabled := False;rnrn //如果窗口不在最顶部,不用隐藏。rn if Self.Top > 0 thenrn Exit;rnrn //将窗口上缩,只显示三个像素rn Self.Top := -Self.Height + 3;rnend;rnrn****************************rn* 以上为窗口控制相关过程 *rn****************************
如何把C++语言编写的代码转换成C语言
nn```n #include n#include n#include n#include n#include n#define N 50 //系统中学生的最大数量nint n=3; //学生数量的初始值nnstruct student nn int sid;n char name[10];n char num[14];n float chinese;n float english;n float clanguage;n float totalscore;n float average;n;nnvoid print(bool menu)//打印基本信息nn if(!menu)n n cout<<<>number;n for(int i=0;i>temp;n switch (temp)n n case 1://按照学号查询n n char number[14];n cout<<>number;n for(i=0;i>nam;n for(i=0;i>temp;n switch (temp)n n case 1://按照学号排序n n int j,index;n char min[14];n for(i=0;i0)n n index=j;n n n if(index!=i)n n stemp=arr[index];n arr[index]=arr[i];n arr[i]=stemp;n n n Display(arr,n);n n break;n case 2://按照总分排序n n int bound,exchange=n-1;n while(exchange!=0)n n bound=exchange;n exchange=0;n for(i=0;i>arr[n-1].name;n cout<>arr[n-1].num;n cout<>arr[n-1].chinese;n cout<>arr[n-1].english;n cout<>arr[n-1].clanguage;n arr[n-1].totalscore=arr[n-1].chinese + arr[n-1].english + arr[n-1].clanguage;n arr[n-1].average=arr[n-1].totalscore/3;n cout<<>select;n while(0>select;n break;n default:n break;n n if(select==1)n break;n n if(select>=7)n flag=false;n elsen flag=true;n if(flag)n n cout<<>select;n while(select>0 && select<<>select;n n n Save(arr,n);n cout<<
Deiphi的代码怎么转换成C或者C ++
我手里有一段用Delphi写的源码,好像是用来生成一个DLL文件的。rn我想把它里面的函数内容转化为C语言或者C++编写的,不知道哪位大佬能帮我看一看,不胜感激~rnlibrary PSIdll;rnconst rn Pkg8400Len = 4120;rn Pkg8400ChNum = 1024;rntypern Byte69 = array[0..68] of Byte;rn Single16 = array[0..15] of Single;rn Byte8400 = array[0..Pkg8400Len-1] of Byte;rn Single8400 = array[0..Pkg8400ChNum-1] of Single;rn DataPkgType =packed recordrn st: Byte;rn SN: integer;rn ChData: Single16;rn end;rnrn//以下是PSI扫描器数据包解码函数rn//单个4字节格式7->单精度浮点数 rnFunction ToSingle(s1,s2,s3,s4:byte): Single; stdcall;rnVar spt:^single;rn sary:array[0..3] of byte;rnbeginrn sary[0]:=s4;rn sary[1]:=s3;rn sary[2]:=s2;rn sary[3]:=s1;rn spt:=@sary;rnrn ToSingle:=spt^;rnend;rnrn//单个4字节格式8->单精度浮点数rnFunction ToSingle8(s1,s2,s3,s4:byte): Single; stdcall;rnVar spt:^single;rn sary:array[0..3] of byte;rnbeginrn sary[0]:=s1;rn sary[1]:=s2;rn sary[2]:=s3;rn sary[3]:=s4;rn spt:=@sary;rnrn ToSingle8:=spt^;rnend;rnrnrn//单个69字节数据包->16个单精度浮点数rnFunction Decode9000(var rBuff: Byte69; psiFormat:integer;var SN:Longint; var ChData:Single16): integer;stdcall;rnvar rn myData: ^DataPkgType;rn byteAry: Byte69;rn i: integer;rnrnBeginrn if (rBuff[0]>3) or (rBuff[0]格式8rn byteAry[i*4+1]:= rBuff[i*4+4];rn byteAry[i*4+2]:= rBuff[i*4+3];rn byteAry[i*4+3]:= rBuff[i*4+2];rn byteAry[i*4+4]:= rBuff[i*4+1];rn end;rn myData:=@byteAry;rn end;rn rn 8:rn myData:=@rBuff;rnrn elsern Decode9000:=1;rn exit;rn end;rn Decode9000:=0;rn ChData :=myData^.ChData;rn SN:= myData^.SN;rnEnd;rnrn//==============================rn//Decode DTCInitium 和8400数据包rnFunction DecodeDTC8400(var rBuff: Byte8400; var SN:Longint; var ChData:Single8400): integer;stdcall;rnVar spt:^single;rn sary:array[0..3] of byte;rn DataNum: integer;rn i: integer;rnrnBeginrn DecodeDTC8400:=1;rn//报头解析:应答包rncase rBuff[1] ofrn4,8,9,128: //简单应答包rn beginrn DecodeDTC8400:=1;rn for i:=0 to 63 dorn begin rn ChData[i] := 0.0;rn end;rn rn SN:= 0;rn end;rnrn19: //数据流包rn if rBuff[0] = 250 thenrn beginrn DecodeDTC8400:=0;rn SN := rBuff[4];rn SN := SN *256 + rBuff[5];rn DataNum := rBuff[6];rn DataNum := DataNum *256 + rBuff[7]; //得到数据点数rn rn//字节倒序,8400总是使用格式7,大头格式 rn for i:=0 to DataNum-1 do //DataNum-1rn begin //交换字节顺序,格式7->格式8rn sary[0]:= rBuff[i*4+24+3];rn sary[01]:= rBuff[i*4+24+2];rn sary[02]:= rBuff[i*4+24+1];rn sary[03]:= rBuff[i*4+24];rn spt:=@sary;rn ChData[i] := spt^;rn end;rn end;rnrnelse //其它不解码rn beginrn DecodeDTC8400:=1;rn for i:=0 to 63 dorn begin rn ChData[i] := 0.0;rn end;rn rn SN:= 0;rn end;rnend;rn rnEnd;rn rnexportsrnrn ToSingle ,rn ToSingle name 'Tosingle',rn ToSingle name 'ToSingle7',rn ToSingle8,rn DecodeDTC8400,rn Decode9000;rnbeginrnrnend.rn
这段c代码如何改写???? 谢谢
int CreateHead(char * Buffer,WORD Length,DWORD NO,WORD Type,DWORD ID)rnrn memcpy(Buffer,&Length,sizeof(WORD));rn memcpy(Buffer+sizeof(WORD),&NO,sizeof(DWORD));rn memcpy(Buffer+sizeof(WORD)+sizeof(DWORD),&Type,sizeof(WORD));rn memcpy(Buffer+sizeof(WORD)*2+sizeof(DWORD),&ID,sizeof(DWORD));rn return sizeof(WORD)*2+sizeof(DWORD)*2;rn
用c如何简化这段代码
[code=C/C++]rnvoid fun_a(int n,double a2,Struct1 a3, Struct2 a4)rnrn <em>代码</em>段Arn for(int i=0; i
请教...这段C代码如何转成delphi?
void SendALL(DWORD IPos, DWORD IId) rn rn BYTE buf[10] = 0; rn memset(buf,0,10); rn buf[0] = 0x23; rn buf[3] = 0x10; rn *(DWORD *)(buf+2) = IPos; rn *(DWORD *)(buf+8) = IId; rn rnrn.........郁闷了很久的问题rn
求把这段代码转换成C#
Oleobject seiproxy rnseiproxy =create oleobjectrnvi= seiproxy.connecttonewobject(‘seiproxy’)rnif vi<>0 thenrn messagebox(‘’,‘注册失败’)rn return rnend ifrnrn<em>这段</em><em>代码</em>是第三方给的一个实例 pb的rnrn 我c#引用的时候一直提示找不到入口点函数“Initialize”也就是我要调用的函数,接口文档也说有这个函数,我电话咨询第三方他们说要“进行接口实例的创建” c#我就有点不明白到底是什么意思rnrnc# <em>代码</em>如下rn [DllImport("seiproxy.dll",rn EntryPoint = "Initialize",rn SetLastError = true,rn CharSet = CharSet.Unicode,rn ExactSpelling = true,rn CallingConvention = CallingConvention.StdCallrn )rn]rn private static extern int Initialize();rnrn通过非托管的方式调用也是提示一样的 愁死我了 求大神rn
可以帮我把这段Matlab程序转换成C语言吗?
如题:rnfunction [ste_cover,len_total]=randlsbhide(input,file,output,key)rncover=imread(input);rnste_cover=cover;rnste_cover=double(set_cover);rnf_id=fopen(file,'r');rn[msg,len_total]=fread(f_id,'ubit1');rn[m,n]=size(ste_cover);rnif len_total>m*nrnerror('嵌入消息量过大,请更换图像');rnendrnp=1;rn[row,col]=randinterval(set_cover,len_total,key);rnfor i=1:len_totalrnset_cover(row(i),col(i))=set_cover(row(i),col(i))-mod(set_cover(row(i),col(i)),2)+msg(p,1);rnif p ==len_totalrnbreak;rnendrnp=p+1;rnendrnste_cover=uint8(ste_cover);rnimwrite(ste_cover,output);rnsubplot(1,2,1);imshow(cover);title('原始图像');rnsubplot(1,2,2);imshow(cover);title('隐藏信息的图像');rnrn这样不好弄的话也可以直接给出用lsb算法进行信息隐藏的C程序(针对灰度的bmp格式图像)
谁能帮我把这段汇编转换成C语言啊
.386PrnDSEG SEGMENT USE16 ;16位数据段rnCfgSpace DB 256 DUP(0) ;PCI设备的256字节配置空间rnbus DW 0 ;bus号,0~255rndev DW 0 ;dev号,0~31rnfunc DW 0 ;func号,0~7rnindex DW 0 ;index,0~63rnDSEG ENDS ;数据段结束rnSSEG SEGMENT PARA STACK ;堆栈段rn DB 512 DUP (0)rnSSEG ENDS ;堆栈段结束rn;字符显示宏指令的定义rnEchoCh MACRO asciirn mov ah,2rn mov dl,asciirn int 21hrn ENDM rnCSEG SEGMENT USE16 ;1<em>代码</em>段rn ASSUME CS:CSEG,DS:DSEGrn; 搜索PCI-IDE设备, 获取PCI配置空间rnFindPCIIDE PROCrn ; bus号从0循环到255rn mov bus, 0rnloop_bus:rn ; dev号从0循环到31rn mov dev, 0rnloop_dev:rn ; func号从0循环到7rn mov func, 0rnloop_func:rn ; index号从0循环到63rnrn mov index, 0rnloop_index:rn ;构造eax为一个32位双字, 写入0cf8h端口rn ;(1 << 31)|(bus << 16)|(dev << 11)|(func << 8)|(index << 2)rn movzx eax,bus ;eax=bus rn movzx ebx,dev ;ebx=dev rn movzx ecx,func ;ecx=funcrn movzx edx,index ;dex=indexrn shl eax,16 ;eax=(bus<<<<<<<< 11)rn or eax,ecx ;eax=..||(func << 8)rn or eax,edx ;eax=..||(index << 2)rn ;从0cf8h端口读取的配置寄存器将保存在CfgSpace[index*4]中rn lea edi,CfgSpace[edx]rn mov dx,0cf8hrn out dx,eax ;eax写入到0cf8h端口rn mov dx,0cfchrn in eax,dx ;从0cfch端口读入 rn cldrn stosd ;配置寄存器保存在CfgSpace中 rn inc indexrn cmp index, 64rn jb loop_index ;index=0~63rn cmp WORD PTR CfgSpace[0ah],0101h ;检查类<em>代码</em>寄存器rn jz FindValidOne ;BaseClass=01h,Sub-Class=01hrn cmp func,0 ;func=0时,检查为多功能设备rn jnz NotFunc0 ;func=1时,不检查 rn test CfgSpace[0eh],80h ;Bit7=1,是多功能设备rn jz NotMultiFunc ;Bit7=0,不是rnNotFunc0:rn inc funcrn cmp func, 8rn jb loop_func ;index=0~7rnNotMultiFunc:rn inc devrn cmp dev, 32rn jb loop_dev ;dev=0~31 rn inc busrn cmp bus, 256rn jb loop_bus ;bus=0~255rnFindValidOne:rn retrnFindPCIIDE ENDP rnStart PROCrn mov ax,DSEGrn mov ds,ax ;ds指向数据段rn mov es,ax ;es指向数据段rn call FindPCIIDE ;搜索PCI-IDE设备rn lea si,CfgSpace ;显示配置空间中的256字节数据rn cldrn mov bp,256/16rnNextLine: mov cx,16rnNextCh: lodsbrn push axrn shr al,4rn call ToASCIIrn EchoCh alrn pop axrn call ToASCIIrn EchoCh alrn EchoCh ' 'rn loop NextChrn EchoCh 0dhrn EchoCh 0ahrn dec bprn jnz NextLinern mov ax,4c00hrn int 21hrnStart ENDPrnToASCII PROCrn and al,0fhrn cmp al,10rn jae Over10rn add al,'0'rn retrnOver10:rn add al,'A'-10rn retrnToASCII ENDPrnCSEG ENDS ;<em>代码</em>段结束rn END Start
这段C代码错在哪里?
就是一个简单的程序把La和Lb合并且没有重复元素,不知道问题出在哪,编译通过了,但是运行错误,感觉好像是数组越界了?rn求指导...rn[code=c]rn #include rnrn void Union(char *La, char *Lb);rn int ListLength(char *L);rn void GetElem(char *L, int i, char *e);rn int LocateElem(char *L, char *e, int (*comp)(char a, char b));rn int compare(char a, char b);rn void ListInsert(char *, int, char *);rnrn int main()rn char *La;rn char *Lb;rn int i;rn for(i = 0; i ;rn *(L + i - 2) = *e;rn [/code]
怎样翻译这段C代码
调用Dll文件中的一个函数rn int ret;rn char * host_list[3] = "192.168.0.2", "192.168.0.3", "";rnrn // 初始化布控函数库rn ret = READCD(host_list);rnrn其中READCD是DLL文件定义的函数,声明如下rnint READCD(char ** host_list);rnrn谢谢!
帮忙解释一下这段C代码
for (offset = 0; offset < FLASH_SIZE; offset += MMU_SECTION_SIZE) rn cached_addr += offset;rn uncached_addr += offset;rn *(mmu_tlb_base + (cached_addr >> 20)) = \ //***rn (cached_addr | MMU_SECDESC | MMU_CACHEABLE);rn *(mmu_tlb_base + (uncached_addr >> 20)) = \ //***rn (cached_addr | MMU_SECDESC);rn rnrn感觉不是很能理解,特别是标注***的地方!谢谢了。
这段c代码是什么意思
#include //这个我知道rnrnvoid main (int argc, char **argv, char **env) //这个有点糊涂 :(rn rn while (*env) //不明白rn printf("%s\n", *env++); //很不明白rn rnrnrn谢谢大家
QT 如何显示 °c
QT <em>如何</em>显示 °crnrn在windows下应该没问题,但到linux 下最近用输入法打出的℃ 是否存在编码问题?rn该<em>如何</em>显示?
求助,把一段C代码转换成等价的VB代码
#include "stdio.h"rn#include "windows.h"rnvoid *r;rnint _tmain(int argc, _TCHAR* argv[])rnrn HMODULE hm = ::LoadLibrary("VerifyCode.dll");rn DWORD faddr1, faddr2, faddr3;rn char *p = "c:\\1.jpg";rn r = (void *)malloc(16);rn memset(r, 0, 16);rn faddr1 = (DWORD)::GetProcAddress(hm, "InitVerifyCodePick");rn faddr2 = (DWORD)::GetProcAddress(hm, "GetVerifyCode");rn faddr3 = (DWORD)::GetProcAddress(hm, "UnInitVerifyCodePick");rn _asmrn rn call faddr1rn push rrn push prn call faddr2rn call faddr3rn rn MessageBox(NULL, (char *)r, "o", MB_OK);rn CloseHandle(hm);rn return 0;rnrn///////////////////////////////////////////rn _asmrn rn call faddr1rn push rrn push prn call faddr2rn call faddr3rn rn实际上等价于rnInitVerifyCodePick();rnGetVerifyCode(p, r); //两个参数都是字符指针rnUnInitVerifyCodePick();rn
请求帮忙把一段C代码转换成VB代码!
这一段<em>代码</em>是用在游戏里的,rn就是流星蝴蝶剑这款单机游戏,rn请求帮忙把<em>这段</em><em>代码</em><em>转换成</em>VB<em>代码</em>!rn<em>代码</em>如下rnrn[code=C#]rn#include rnrn#define BUTTON1 101 rnrnrn#define EDIT1 201 rn#define EDIT2 202 rn#define EDIT3 203 rnrnrn#define HOTKEYIDCHEAT 200 rn#define HOTKEYIDRECOVER 201 rnrnrnLRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); rnrnunsigned char Code[10]=0x8d, 6, 0xa3, 0x60, 0x19, 0x5d, 0, 0x90, rn 0x90, 0x90; rnrnunsigned char CodeOrigin[10]=0x8B, 0x86, 0xA8, 0x22, 0, 0, 0x85, rn 0xc0, 0x75, 0x7e; rnrnvoid MyWinMain() rn MSG msg; rn WNDCLASS wc; rn memset(&wc, 0, sizeof(wc) ); rn wc.hInstance = (HINSTANCE)0x400000; rn wc.lpfnWndProc = (WNDPROC)WndProc; rn wc.lpszClassName = "IdentityClass"; rn wc.hbrBackground = (HBRUSH)COLOR_WINDOW; rn RegisterClass(&wc); rn rn CreateWindow("IdentityClass", "血刀门设置门派阶级", WS_OVERLAPPEDWINDOW | WS_VISIBLE, rn 200, 200, 270, 200, NULL, NULL, (HINSTANCE)0x400000, NULL); rnrnrnrnrn while (GetMessage(&msg, NULL, 0, 0)) rn rn TranslateMessage(&msg); rn DispatchMessage(&msg); rn rnrn rnrnLRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) rn rnswitch (message) rn rn case WM_DESTROY: rn PostQuitMessage(0); rn break; rn rn rn case WM_CREATE: rnrn CreateWindow("STATIC", "门派:", WS_CHILD | WS_VISIBLE, rn 20, 22, 50, 20, hWnd, 0, (HINSTANCE)0x400000, NULL); rn rn CreateWindow("STATIC", "身份:", WS_CHILD | WS_VISIBLE, rn 20, 55, 50, 20, hWnd, 0, (HINSTANCE)0x400000, NULL); rn rnrn CreateWindow("STATIC", "狙杀人数:", WS_CHILD | WS_VISIBLE, rn 20, 90, 100, 20, hWnd, 0, (HINSTANCE)0x400000, NULL); rn rn CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX", 0, WS_CHILD | WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWN , rn 70, 15, 145, 100, hWnd, (HMENU)EDIT1, (HINSTANCE)0x400000, NULL); rn SendDlgItemMessage(hWnd, EDIT1, CB_ADDSTRING, NULL, (LPARAM)"血刀门"); rn SendDlgItemMessage(hWnd, EDIT1, CB_ADDSTRING, NULL, (LPARAM)"血洗浩方互动"); rn SendDlgItemMessage(hWnd, EDIT1, CB_SETCURSEL, 0, 0); rnrn CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX", 0, WS_CHILD | WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWN , rn 70, 50, 145, 100, hWnd, (HMENU)EDIT2, (HINSTANCE)0x400000, NULL); rn SendDlgItemMessage(hWnd, EDIT2, CB_ADDSTRING, NULL, (LPARAM)"掌门"); rn SendDlgItemMessage(hWnd, EDIT2, CB_ADDSTRING, NULL, (LPARAM)"武林至尊"); rn SendDlgItemMessage(hWnd, EDIT2, CB_SETCURSEL, 0, 0); rnrn rn CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "0", WS_CHILD | WS_VISIBLE| WS_TABSTOP|WS_BORDER , rn 100, 85, 90, 25, hWnd, (HMENU)EDIT3, (HINSTANCE)0x400000, NULL); rn rn CreateWindow("BUTTON", "更改", WS_CHILD | WS_VISIBLE , rn 80, 120, 50, 30, hWnd, (HMENU)BUTTON1, (HINSTANCE)0x400000, NULL); rnrn break; rnrn rn case WM_COMMAND: rn if(wParam==BUTTON1) rn DWORD addr1, addr2; rn rn HWND MeteorhWnd; rn DWORD MeteorPID, NoUse; rn HANDLE MeteorProc; rnrn rn DWORD indentity[6]; rn int exploit; rn int length; rn char Division[20]; rn char Class[20]; rn rn MeteorhWnd = FindWindow("Lz3DCWANG", NULL); rn GetWindowThreadProcessId(MeteorhWnd, &MeteorPID); rn MeteorProc = OpenProcess(PROCESS_ALL_ACCESS, 0, MeteorPID); rn rn VirtualProtectEx(MeteorProc, (LPVOID)0x48AC53, 10, rn PAGE_EXECUTE_READWRITE,&NoUse); rn rn WriteProcessMemory(MeteorProc, (LPVOID)0x48AC53, Code, 10, 0); rn Sleep(300); rn ReadProcessMemory(MeteorProc, (LPVOID)0x5D1960, &addr1, 4, &NoUse); rn addr1=addr1+0x2934; rn addr2=addr1+0x10; rn WriteProcessMemory(MeteorProc, (LPVOID)0x48AC53, CodeOrigin, 10, 0); rn rnrn indentity[0]=0x5D3900; rn indentity[3]=0x5D3920; rn rn length=GetDlgItemText(hWnd, EDIT1, Division, 19); rnrn indentity[1]=0x5D3900+length; rn indentity[2]=indentity[1]+1; rn Division[length+1]=' '; rn WriteProcessMemory(MeteorProc, (LPVOID)0x5D3900, Division, length+2, 0); rn rn length=GetDlgItemText(hWnd, EDIT2, Class, 19); rnrn indentity[4]=0x5D3920+length; rn indentity[5]=indentity[1]+1; rn Class[length+1]=' '; rn WriteProcessMemory(MeteorProc, (LPVOID)0x5D3920, Class, length+2, 0); rnrn exploit=GetDlgItemInt(hWnd, EDIT3, 0, 0); rn rn rn WriteProcessMemory(MeteorProc, (DWORD*)addr1, &exploit, 4, 0); rnrn WriteProcessMemory(MeteorProc, (DWORD*)addr2, indentity, 24, 0); rnrn CloseHandle(MeteorProc); rn rn break; rnrn default: rn return DefWindowProc(hWnd, message, wParam, lParam); rn rnrn[/code]
成功把C代码转换成C#代码的送出120分!!
#include rn#include rn#include rn#include rnrn#define HZK16 "hzk16"rnrnint test(unsigned int a,int k)rnrna<<< =(k-1);rn if (a & 0x80)rn return true;rn elsern return false;rn rnrn不知道正确应该怎么改rn
怎么把c代码转换成vc代码???????? 急,来着给分
怎么把c<em>代码</em><em>转换成</em>vc<em>代码</em>???????? 急,来着给分
怎么把这几段C语言代码转换成C#代码的??
怎么把这几段C语言<em>代码</em><em>转换成</em>C#<em>代码</em>的??rn请各位XDJM们帮我看看。rn在此先谢谢了。rnrn(1)rnuint8 CDT_BCH_Check(uint8 *pucBuff, uint8 ucCdtVer) rn rnstatic const uint8 aucBchD709[]= rn rn0x00, 0xE0, 0x70, 0x90, 0x38, 0xD8, 0x48, 0xA8, rn0x1C, 0xFC, 0x6C, 0x8C, 0x24, 0xC4, 0x54, 0xB4, rn0x0E, 0xEE, 0x7E, 0x9E, 0x36, 0xD6, 0x46, 0xA6, rn0x12, 0xF2, 0x62, 0x82, 0x2A, 0xCA, 0x5A, 0xBA, rn0x07, 0xE7, 0x77, 0x97, 0x3F, 0xDF, 0x4F, 0xAF, rn0x1B, 0xFB, 0x6B, 0x8B, 0x23, 0xC3, 0x53, 0xB3, rn0x09, 0xE9, 0x79, 0x99, 0x31, 0xD1, 0x41, 0xA1, rn0x15, 0xF5, 0x65, 0x85, 0x2D, 0xCD, 0x5D, 0xBD, rn0xE3, 0x03, 0x93, 0x73, 0xDB, 0x3B, 0xAB, 0x4B, rn0xFF, 0x1F, 0x8F, 0x6F, 0xC7, 0x27, 0xB7, 0x57, rn0xED, 0x0D, 0x9D, 0x7D, 0xD5, 0x35, 0xA5, 0x45, rn0xF1, 0x11, 0x81, 0x61, 0xC9, 0x29, 0xB9, 0x59, rn0xE4, 0x04, 0x94, 0x74, 0xDC, 0x3C, 0xAC, 0x4C, rn0xF8, 0x18, 0x88, 0x68, 0xC0, 0x20, 0xB0, 0x50, rn0xEA, 0x0A, 0x9A, 0x7A, 0xD2, 0x32, 0xA2, 0x42, rn0xF6, 0x16, 0x86, 0x66, 0xCE, 0x2E, 0xBE, 0x5E, rn0x91, 0x71, 0xE1, 0x01, 0xA9, 0x49, 0xD9, 0x39, rn0x8D, 0x6D, 0xFD, 0x1D, 0xB5, 0x55, 0xC5, 0x25, rn0x9F, 0x7F, 0xEF, 0x0F, 0xA7, 0x47, 0xD7, 0x37, rn0x83, 0x63, 0xF3, 0x13, 0xBB, 0x5B, 0xCB, 0x2B, rn0x96, 0x76, 0xE6, 0x06, 0xAE, 0x4E, 0xDE, 0x3E, rn0x8A, 0x6A, 0xFA, 0x1A, 0xB2, 0x52, 0xC2, 0x22, rn0x98, 0x78, 0xE8, 0x08, 0xA0, 0x40, 0xD0, 0x30, rn0x84, 0x64, 0xF4, 0x14, 0xBC, 0x5C, 0xCC, 0x2C, rn0x72, 0x92, 0x02, 0xE2, 0x4A, 0xAA, 0x3A, 0xDA, rn0x6E, 0x8E, 0x1E, 0xFE, 0x56, 0xB6, 0x26, 0xC6, rn0x7C, 0x9C, 0x0C, 0xEC, 0x44, 0xA4, 0x34, 0xD4, rn0x60, 0x80, 0x10, 0xF0, 0x58, 0xB8, 0x28, 0xC8, rn0x75, 0x95, 0x05, 0xE5, 0x4D, 0xAD, 0x3D, 0xDD, rn0x69, 0x89, 0x19, 0xF9, 0x51, 0xB1, 0x21, 0xC1, rn0x7B, 0x9B, 0x0B, 0xEB, 0x43, 0xA3, 0x33, 0xD3, rn0x67, 0x87, 0x17, 0xF7, 0x5F, 0xBF, 0x2F, 0xCF rn; rnstatic const uint8 aucBchEb90[]= rn rn0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15, rn0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D, rn0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65, rn0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D, rn0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5, rn0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD, rn0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85, rn0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD, rn0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2, rn0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA, rn0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2, rn0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A, rn0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32, rn0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A, rn0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42, rn0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A, rn0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C, rn0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4, rn0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC, rn0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4, rn0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C, rn0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44, rn0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C, rn0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34, rn0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B, rn0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63, rn0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B, rn0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13, rn0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB, rn0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83, rn0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, rn0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3 rn; rnstatic const uint8 *pucTable; rnuint16 unSize; rnuint8 ucRslt; rnrnif (ucCdtVer & BCH_DL451) pucTable=aucBchD709; rnelse pucTable=aucBchEb90; rnrnfor (ucRslt=0, unSize=5; unSize!=0; unSize--) rnucRslt=pucTable[ucRslt^(*pucBuff++)]; rnrnreturn (~ucRslt); rn rnrn(2)rnunsigned int cal_crc(unsigned char *ptr, unsigned char len) rn unsigned char i; rn unsigned int crc=0; rn while(len--!=0) rn for(i=0x80; i!=0; i/=2) rn if((crc&0x8000)!=0) crc*=2; crc^=0x1021; /* 余式CRC乘以2再求CRC */ rn else crc*=2; rnif((*ptr&i)!=0) crc^=0x1021; /* 再加上本位的CRC */ rn rn ptr++; rn rn return(crc); rn rnrn(3)rnunsigned int cal_crc(unsigned char *ptr, unsigned char len) rn unsigned int crc; rn unsigned char da; rn unsigned int crc_ta[256]= /* CRC余式表 */ rn 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, rn0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, rn 0x 1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, rn 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, rn 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, rn 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, rn 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, rn 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, rn 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, rn 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, rn 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, rn 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, rn 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, rn 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, rn 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, rn 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, rn 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, rn 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, rn 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, rn 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, rn 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, rn 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, rn 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, rn 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, rn 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, rn 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, rn 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, rn 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, rn 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, rn 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, rn 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, rn 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 rn ; rnrn crc=0; rn while(len--!=0) rn da=(uchar) (crc/256); /* 以8位二进制数的形式暂存CRC的高8位 */ rn crc < <=8; /* 左移8位,相当于CRC的低8位乘以 */ rn crc^=crc_ta[da^*ptr]; /* 高8位和当前字节相加后再查表求CRC ,再加上以前的CRC */ rn ptr++; rn rn return(crc); rn rn
C代码转换成Delphi的问题
哪位大虾帮我转换一下,有几个地方我有点蒙……rn谢谢了先!!!rnrn//----------------------------------------------------------------------------rn#ifndef WINIO_Hrn#define WINIO_Hrnrn#ifdef WINIO_DLLrn#define WINIO_API _declspec(dllexport)rn#elsern#define WINIO_API _declspec(dllimport)rn#endifrnrnextern "C"rnrn WINIO_API bool _stdcall InitializeWinIo();rn WINIO_API void _stdcall ShutdownWinIo();rn WINIO_API PBYTE _stdcall MapPhysToLin(PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle);rn WINIO_API bool _stdcall UnmapPhysicalMemory(HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr);rn WINIO_API bool _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal);rn WINIO_API bool _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal);rn WINIO_API bool _stdcall GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize);rn WINIO_API bool _stdcall SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize);rn WINIO_API bool _stdcall InstallWinIoDriver(PSTR pszWinIoDriverPath, bool IsDemandLoaded = false);rn WINIO_API bool _stdcall RemoveWinIoDriver();rnrnrnextern bool IsNT;rnextern HANDLE hDriver;rnextern bool IsWinIoInitialized;rnrnbool _stdcall StartWinIoDriver();rnbool _stdcall StopWinIoDriver();rnrn#endifrn//----------------------------------------------------------------------
C代码转换成DELPHI。(紧急)
拿位兄弟帮助我下面C<em>代码</em><em>转换成</em>DELPHI。rnrnvoid DWORD2Char(char* Buffer,DWORD Value)rnrn DWORD Status,TmpSatus;rn TmpSatus=Value;rn int i1,i2,i3,i4;rn i1=0;i2=0;i3=0;i4=0;rn i1=TmpSatus/(256*256*256);rn Status=TmpSatus%(256*256*256);rn TmpSatus=Status;rnrn i2=TmpSatus/(256*256);rn Status=TmpSatus%(256*256);rn TmpSatus=Status;rnrn i3=TmpSatus/(256);rn Status=TmpSatus%(256);rn TmpSatus=Status;rn rn i4=TmpSatus;rn Buffer[0]=(BYTE)i1;rn Buffer[1]=(BYTE)i2;rn Buffer[2]=(BYTE)i3;rn Buffer[3]=(BYTE)i4;rn rn return;rnrn
求助,这段java转换成c语言
//luying add vip process listnString []vipProcesses = "com.xxx","com.yyy ";nnString []importantProperties = n "ro.epay.mode",n "ro.epay.mockup.mode",n "ro.epay.product.debug",n "ro.epay.product.mode",n "ro.epay.authmode",nn "persist.sys.usb.config",n "sys.usb.config"nn;nnn//luying start inquire process name by pidnString pname = getProcessName(cr.pid+"");nn//先判断访问的属性是否敏感属性nfor(int i = 0;i
这段C怎么转换成C++输入输出
int *pafirst=NULL;rnrnprintf("\n输入运动项目序号 (x,pafirst); rn overgame = *pafirst; rn if ( pafirst != phead )
将matlab代码转换成C代码
相信大家遇到一些非常头疼的问题:matlab编写好了,但是对应的C语言<em>代码</em>不知<em>如何</em>去写。比如编写好了神经网络<em>代码</em>,仿真结果属于非常满意的那种状况,但是C语言该怎么写呢??  MATLAB 自带的 MATLAB Coder 工具,就能帮助我们解决这一问题。MATLAB Coder可以从MATLAB<em>代码</em>生成独立的、可读性强、可移植的C/C++<em>代码</em>。一些博主已经写的非常详细了,大家可以参考:https:...
BMP转换成c代码数组
把bmp图片转换为相应的 .C文件<em>代码</em>。wince开机logo转换工具,可用于S3C2440,2410,2416,6410,经过S3C2416开发板测试,logo显示正常。提供源码文件。下载完后解压,进入bmp2c\bin\Debug双击bmp2c.exe,选择需要转换的图片和转换后文件的存放位置,主要需要输入转换图片的高度和宽度。
这段JAVA代码怎么转换成C/C++语言
writeBuffer[0] = (byte)(v >>> 56);rn writeBuffer[1] = (byte)(v >>> 48);rn writeBuffer[2] = (byte)(v >>> 40);rn writeBuffer[3] = (byte)(v >>> 32);rn writeBuffer[4]=(byte)(v>>24);rn writeBuffer[5]=(byte)(v>>16);rn writeBuffer[6]=(byte)(v>>8);rn writeBuffer[7]=(byte)(v>>0);rn我自己写的<em>代码</em>运行效果跟JAVA的运行效果不一样。大家有什么好的办法。
Qt C/C++代码统计工具
自己做了一个<em>代码</em>统计工具,目前只设置了统计c/c++<em>代码</em>文件,当然你可以根据你的实际情况编译修改,还支持多语言切换。
谁能帮忙把这段Fortran代码转换成C代码,分不够可以再加
如题,程序如下:rn(1)读入数据程序rnPROGRAM MAINrnCOMMON TYP(10),NO(10),NFO(10),NTO(10),NCO(10),VAL(10)rnCOMMON/B1/T (29, 30), NOD, NBR, M, NrnOPEN (3, FILE=’DD.DAT’, STATUS=’OLD’)rnREAD (3,*)rnREAD (3,*) NBRrnWRITE (*,*)rnWRITE (*,*)rnDO 10 I=1, NBRrn READ (3,2) TYP(I),NO(I),NFO(I),NTO(I),NCO(I),VAL(I)rn WRITE(*,4) TYP(I),NO(I),NFO(I),NTO(I),NCO(I),VAL(I)rn NOD=MAX0 (NOD, NFO (I), NTO (I))rn10 CONTINUErn2 FORMAT (A2, 4I3, G10.3)rn4 FORMAT (5X, A2, 3X, 3(I3, 2X), I3.0, G12.4) rnM=NOD+2*NBRrnN=M+1rnCALL FORMTrnCALL GAUSSrnCALL OUTPUTrnENDrnrn(2) 形成表格方程rnSUBROUTINE FORMTrnCOMMON TYP(10),NO(10),NFO(10),NTO(10),NCO(10),VAL(10)rnCOMMON/B1/T (29, 30), NOD, NBR, M, NrnDO 10 J=1, NBRrn NF=NFO (J)rn NT=NTO (J)rn MI=NOD+NBR+Jrn MJ=NOD+Jrn NI=MIrnNJ=MIrnC KCL: Ai=0 and KVL: u=AT*vrn IF (NF.NE.0) THENrn T (NF, MI) =1.rn T (MJ, NF) =-1.rn END IFrn IF (NT.NE.0) THENrn T (NT, MI) =-1rn T (MJ, NT) =-1.rn END IFrn T (MJ, MJ) =1.0rnC VCR: Mv + Ni = urn IF (TYP (J).EQ.’R’.OR.TYP (J).EQ.’V’) THENrn T (MI, MJ) =1rn IF(TYP(J).EQ.’R’) T(NI,NJ)=-VAL(J)rn IF(TYP(J).EQ.’V’) T(NI,N)=VAL(J)rn END IFrn IF (TYP (J).EQ.’G’.OR.TYP (J).EQ.’I’) THENrn IF(TYP(J).EQ.’G’) T(MI,MJ)=-VAL(J)rn IF(TYP(J).EQ.’I’) T(MI,N)=VAL(J)rn T(NI,NJ)=1rn END IF rn IF (TYP (J).EQ.’VV’.OR.TYP (J).EQ.’VC’) THENrn IF(TYP(J).EQ.’VV’) T(MI,MJ)=1rn IF(TYP(J).EQ.’VC’) T(NI,NJ)=1rn T(MI,NOD+NCO(J))=-VAL(J)rn END IFrn IF (TYP (J).EQ.’CC’.OR.TYP (J).EQ.’CV’) THENrn IF(TYP(J).EQ.’CC’) T(NI,NJ)=1rn IF(TYP(J).EQ.’CV’) T(NI,NJ)=1rn T(NI,NOD+NBR+NCO(J))=-VAL(J)rn END IF rn10 CONTINUErn ENDrnrn(3)调用GAUSS求解方程rnSUBROUTINE GAUSSrnCOMMON / B1 / T(29,30),NOD,NBR,M,NrnDO 10 K = 1,Mrn20 IF(ABS(T(I,K)).GT.ABS(T(L,K))) L=IrnIF(ABS(T(L,K)).LT.1.E-30) STOP ’电路无唯一解’rnIF(L.NE.K) THENrnDO 30 J = K,Nrn T1 = T(K,J)rn T(K,J) = T(L,J)rn30 T(L,J) = T1rn END IF rnDO 40 I = K,MrnC = T(I,K)rnIF(C.NE.0.0) THENrn DO 50 J = K,NrnT(I,J) = T(I,J)/Crn50 IF(I.GT.K) T(I,J) = T(I,J)-T(K,J)rnEND IF rn40 CONTINUErn10 CONTINUErn DO 60 I = M-1, 1,-1rn DO 60 J = M, I+1,-1rn60 T(I,N) = T(I , N)-T(I ,J)*T(J, N)rnENDrnrn输出子程序rnSUBROUTINE OUTPUTrnCOMMON TYP (10), NO (10), NFO (10), NTO (10), NCO (10), VAL (10)rnCOMMMON / B1 / T (29, 30), NOD, NBR, M, NrnWRITE (*, 2)rn2 FORMAT(/5X,’节点电压’)rn WRITE (*, 4) (J, T (J, N)), J = 1, NOD)rn4 FORMAT(5X, 4(:,’V’,I2,’=’,G12.4,1X))rn WRITE (*, 6)rn6 FORMAT( /5X,’支路电压’,9X,’支路电流’,9X’支路功率’)rn DO 10 J = 1, NBRrn P = T (NOD+J, N)*T (NOD+NBR+J, N)rn10 WRITE (*, 12) J, T (NOD+J, N), J T (NOD+NBR+J, N), J, Prn12 FORMAT (5X, ‘U’, I2,’=’, G12.4,’I’, I2,’=’, G12.4,’P’, I2,’=’, G12.4)rn ENDrn
如何代码转换成图片!
就是比方说一个论坛里发贴的时候 打一个#11 发贴的后,显示的是相对的图片,rn请问这个怎么实现。
如何转换成.给出代码???
麻烦大虾给出具体<em>代码</em>。rn如原来的格式是ddfd这是从数据库里查询出的内容,rn把它<em>转换成</em>rn帮忙。
请将这段c代码改为delphi代码
static void GetMACaddress(void)rnrn IP_ADAPTER_INFO AdapterInfo[16]; // 定义网卡信息存贮区。rn DWORD dwBufLen = sizeof(AdapterInfo); rnrn DWORD dwStatus = GetAdaptersInfo( rn AdapterInfo, // [output] 指向接收数据缓冲指针rn &dwBufLen); // [input] 缓冲区大小rn assert(dwStatus == ERROR_SUCCESS); // 此处是个trap,用来保证返回值有效rnrn PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; rn do rn PrintMACaddress(pAdapterInfo->Address); // 打印MAC地址rn pAdapterInfo = pAdapterInfo->Next; rn rn while(pAdapterInfo); rnrn
简单的Delphi代码转换成C代码
请哪位大侠将以下<em>代码</em><em>转换成</em>C<em>代码</em>,多谢!rnrnvarrn a: PChar; rn e: UTF8String;rnbeginrn a := '鍟婂搱123'; rn e := Utf8Decode(a); //把 UTF8 給 Decode 成 Unicode,rn a := PChar(String(e));rnend;
C语言代码转换成C#代码的问题
[code=C/C++]rn__int16 dc_pro_commandlink(HANDLE ICDev,unsigned char slen,unsigned char * sbuff,unsigned char *rlen,unsigned char * rbuff,unsigned char tt,unsigned char FG)rnrn说明:应用协议数据单元信息交换函数。该函数已封装T=CL操作rnrn调用:int ICDev ----dc_init 函数返回的端口标识符rnrn unsigned char slen ---- 发送的信息长度rnrn unsigned char * sbuff ---- 存放要发送的信息rnrn unsigned char *rlen ---- 返回信息的长度rnrn unsigned char * rbuff ---- 存放返回的信息rnrn unsigned char tt---- 延迟时间,单位为:10msrnrn unsigned char FG---- 分割长度。建议此值小于64rnrn返回: <0 错误。其绝对值为错误号rnrn =0 成功。rnrn举例:int st;rnrn unsigned char slen,rlen,sneddata[100], recdata[100]; rnrn slen=5;rnrn senddata[0]=0x00;senddata[1]=0x84;senddata[2]=0x00;rnrn senddata[3]=0x00;senddata[4]=0x04;rnrn st= dc_pro_commandlink ( icdev,slen,senddata,&rlen,recdata,7,56) // 对卡发取随机数命令 rnrn[/code]rnrn将这个命令<em>转换成</em>C#,应该怎么写
Fortran代码转换成C代码的问题
问题见rnhttp://community.csdn.net/Expert/topic/5531/5531438.xml?temp=.5937616rnrnlightnut():帮忙回一下
如何将C代码转换成PB代码?
int retcode;rnpublic ipapi_dll.Cipapi lhi;//定义类对象rnlhi = new ipapi_dll.Cipapi();//初始化类实例rnretcode = lhi.SYS_Init();//调用接口的初试化涵数rnif (retcode != 0) //返回0: 初始化成功;返回返回:初始化失败rnrn MessageBox.show("ERROR:初始化医保接口失败!");rnrnrn将上面的<em>代码</em><em>转换成</em>PB<em>代码</em><em>如何</em>转换,请高手指教! 有动态库ipapi_dll.dll
c代码转换成c#代码的问题
怎么把<em>这段</em>c<em>代码</em><em>转换成</em>c#的?rn下面的<em>代码</em>只是个例子,我只想知道怎么转换。rnvoid test(unsigned char a[3],unsigned char b[4])rnrnif(*(a+4)>50)rnb[2]=NULL;rnrn我做了一下修改:rnunsafe void test(char[] a,char[] b)rnrnif(*(&a+4)>50)rnb[2]=NULL;rnrn修改后调试时提示:NULL没定义,&不能使用在托管<em>代码</em>rnrn
mfc编译c代码的问题!!
我有一些<em>代码</em>是.c文件,现在我想把它加入我的<em>mfc</em>工程,但错误提示说没有包含预处理文件,当我加入了#include "stdafx.h"后,程序有如下提示:rnfatal error C1853: 'Debug/CReateAVI.pch' is not a precompiled header file created with this compilerrn就是说工程的类型不对,但是我要编译这些c文件,我该怎么做??????
如何改进这段C语言程序?
我用Microsoft Visual C++ 6.0调试,虽然没有错误,但运行中会产生非法操作,请问<em>如何</em>修改<em>这段</em>程序?rn#includern#includernstruct snodern int data;rn struct snode *next,*pre;rn;rnstruct snode *head,*tail;rnrninit_line()rnrn head=NULL;rnrnrncreat_line()rnrn int e;rn struct snode *p;rn p=(struct snode *)malloc(sizeof(struct snode));rn printf("Input number:");rn scanf("%d",&e);rn while(e)rn rn p->data=e;rn if(head==NULL)rn head=p;rn elsern rn tail->next=p;rn p->pre=tail;rn rn tail=p;rn tail->next=NULL;rn p=(struct snode *)malloc(sizeof(struct snode));rn printf("Input number:");rn scanf("%d",&e);rn rnrnprint()rnrn struct snode *p,*t;rn p=tail;rn while(p)rn rn printf("%d",p->data);rn t=p;rn p=p->pre;rn free(t);rn p->next=NULL;rn rnrnrnmain()rnrn init_line();rn creat_line();rn print();rn
如何把C代码制作成DLL
我用C写了几个数学计算函数(纯数学表达式),可以用什么工具将其制作成DLL?rn我是用TC2.0学C语言的,刚学了2个小时。rnTC中似乎没有有关DLL的选项呀,难道说非要用VC不成?rn ----------------------------------------------- rn 我编了三年程序 只用过VB rn 我用了三年VB 只用过WINSOCK rn 我用了三年WINSOCK 只用过UDP和TCP rn 我用了三年UDP和TCP 原来都用的是TCP/IP协议 rn http://www.offca.com/gps/iphonebbs/rn **********中国网络程序开发联盟欢迎你**********rn -----------------------------------------------
如何把c代码转化为c#
如下一段C<em>代码</em>,怎么转化为c#<em>代码</em>呢?rnrn主要是<em>如何</em>处理指针和函数的问题???rnrn[code=C/C++]rn#define swap(x,y) temp=x; x=y; y=temp//交换操作rnunsigned char temp;rnunsigned char InitialKey[128];rnrntypedef structrnrn unsigned char i;rn unsigned char j;rn unsigned char S[256];rnRC4_STATE; //内部状态rnrnRC4_STATE state;rnrnvoid KSA(unsigned char Key[],RC4_STATE *state,int n)rnrn for(int i=0;iS[i]=i;rn rn int j=0;rn for(int i=0;iS[i]+Key[i%n])%256);rn swap(state->S[i],state->S[j]);rn rn state->i=0;rn state->j=0;rn//KSArnrnunsigned char PRGA(RC4_STATE *state)rnrn state->i=(unsigned char)((state->i+1)%256);rn state->j=(unsigned char)((state->j+state->S[state->i])%256);rn swap(state->S[state->i],state->S[state->j]);rn return state->S[(unsigned char)((state->S[state->i]+state->S[state->j])%256)];rn//PRGArnrnrnRC4_STATE state_p; rnrnunsigned char Z[512];rnunsigned char J;rnunsigned char InitialState[256];rnunsigned char is_determined[256];rnrnvoid induct_fault(unsigned char k,RC4_STATE *state)rnrn unsigned char temp;rn dorn rn temp=rand()%256;rn state->S[k]=(unsigned char)(state->S[k]+temp);rn rn while(temp==0);rnrnrn//得到 T_prnint get_T_p(int t,int n)rnrn KSA(InitialKey,&state_p,n);rn for(int i=1;i= 4) rn rn lenkey=atoi(argv[1]); rn num_attack=atoi(argv[2]);rn Trial=atoi(argv[3]); rn rnrn for(int i = 0;i < Trial;i++)rn rn for(int j=0;j
c 代码 c 代码 c 代码
c <em>代码</em> c <em>代码</em> c <em>代码</em> c <em>代码</em>
谁能帮忙把这段C代码翻译成DELPHI
/*1 Baoheyalizichengxu P=F(T)*/饱和压力子程序rndouble psk(double t)rn double n[]=0.11670521452767e4,-0.72421316703206e6,-0.17073846940092e2,0.12020824702470e5,-0.32325550322333e7,0.14915108613530e2,-0.48232657361591e4,0.40511340542057e6,-0.23855557567849,0.65017534844798e3;rn double a,b,c,ps;rn t=t+273.15;rn t=t+n[8]/(t-n[9]);rn a=t*t+n[0]*t+n[1];rn b=n[2]*t*t+n[3]*t+n[4];rn c=n[5]*t*t+n[6]*t+n[7];rn ps=pow(2*c/(-b+pow(b*b-4*a*c,0.5)),4);rn return ps;rn
怎么把这段C代码用C#完成呢?
在C#里结构体不能用指针rnrntypedef struct rnLONG num_tables; /* number of tables */rnCHAR **tables; /* table names */rnCHAR *where; /* where clause */rn SE_SQL_CONSTRUCT;rnrnrnLONG SE_sql_construct_allocrn(LONG num_tables,rnSE_SQL_CONSTRUCT **constructor);rnrnLONG SE_stream_queryrn(SE_STREAM stream,rnSHORT num_columns,rnconst SE_SQL_CONSTRUCT *construct);rnrnSE_SQL_CONSTRUCT sqlc;rnlong rc; rnrc = SE_sql_construct_alloc (1, &sqlc);rnsqlc->where = malloc(20);rnsqlc->num_tables = 1;rnstrcpy (sqlc->tables[0], "cities");rnstrcpy (sqlc->where, "population < 10000");rnnum_cols = 3;rnrc = SE_stream_query (Stream, num_cols, sqlc);rnrn先感谢大家帮忙,问题解决马上揭帖,在线等!rn
请高手帮忙把这段C的代码转成VB
//#include "stdafx.h"rn#include rn#include rn#include rn#include rn#include rn#define snprintf _snprintfrn#pragma comment(lib,"advapi32")rn#define ALLOWED_USERNAME_CHARS "A-Z,a-z,0-9,-,_,."rn#define MAX_NUM 1024 //500rn#define DOMAINZ "Software\\IpSwitch\\IMail\\Domains"rn#define VER "1.1"rn#define MAXSIZE 100rnrnint total_accs=0;rnint total_domainz=0,total_domain_accs=0;rn/*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*/rnvoid greetz()rnrn printf( "\n\t--= [ IpSwitch IMail Server User Password Decrypter ver %s] =--\n\n"rn "\t\t (c) 2004 by Adik ( netmaniac [at] hotmail.KG )\n\n\n",VER);rnrn/*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*/rnvoid usage()rnrn printf( "------------------------------------------------------------------------\n");rn printf( " Imailpwdump [-d] -- Dumps IMail Server user/pwds from local registry\n\n"rn " Imailpwdump [username] [passwordhash] -- User/PwdHash to decrypt\n\n"rn " eg: Imailpwdump netmaniac D0CEE7D5CCD3D4C7D2E0CAEAD2D3\n");rn printf( "------------------------------------------------------------------------\n");rn rnrn/*OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*/rnvoid str2hex(char *hexstring, char *outbuff)rn rn unsigned long tmp=0;rn char tmpchr[5]=""; rn memset(outbuff,0,strlen(outbuff));rn if(strlen(hexstring) % 2)rn rn printf(" Incorrect password hash!\n");rn exit(1);rn rn if(strlen(hexstring)>MAXSIZE)rn rn printf(" Password hash is too long! \n");rn exit(1);rn rn for(unsigned int i=0, c=0; iMAXSIZE)rn rn printf(" Username too long! \n");rn return;rn rn for(unsigned int i=0;i
请高人帮忙把这段C系列的代码转成Delphi的...
最近在研究天龙八部的客户端.在网上找到一份解密的<em>代码</em>.但是是C系列的.我看不懂.希望达人帮忙转成Delphi的rn<em>代码</em>有2段.在http://www.cppblog.com/tx7do/archive/2008/01/02/40280.html
谁能帮我把这段c语言代码翻译成Pascal语法
在Foxmail中存在一个问题,就是文件和目录位置的关联性很强,我借别人的计算机使用Foxmail收取完了我的邮件,然后只将含有邮件的mail文件夹拷贝到我的计算机的Foxmail中。这下却出了问题,在我的Foxmail中无论<em>如何</em>就是找不到邮件,我又忘了在收取邮件的计算机上Foxmail的安装目录。抱着试一试的心理,我用UltraEdit-32看了一下收件箱in.box内容,由于邮箱没有被压缩,我终于发现了in.box中的一个特征,就是每封邮件都以16进制串“10 10 10 10 10 10 10 11 11 11 11 11 11 53 0D 0A”进行分隔。根据这个特征,我用c语言编写了一个小程序,把in.box中的邮件都读取出来了,并保存为outlook express的eml格式。rnrn  由于在Foxmail中导出邮件的功能并不是很强,尤其是批量导出,不能保存为eml格式,这就使得要想用outlook express来阅读邮件,在Foxmail中必须一封一封进行导出,如果邮件数量太多,有上千封的话,那就太繁琐太浪费时间了,本程序对于in.box中的上千封邮件可以在几秒钟内导出完毕,能节省大量的时间。rnrn  为了使这个程序适合于各种C编译器,我按照ANSI C的标准使用各种函数,经过测试,这个程序在Turbo C 2.0,Borland C++ 3.1,Visual C++ 6.0下都能编译通过,正常运行。为了简化<em>代码</em>,本程序要求in.box放在“D:\net”目录中,如果放邮件的文件不是in.box,需要首先改名为in.box,导出的邮件放在"D:\net\1"目录中。大家可根据需要对程序进行改动,使之更符合自己的需要。rnrnrn  下面是源程序:rnrn  #includern  #includern  #includernrn  int i,j; file://j用作邮件计数,供生成输出文件名时使用rn  FILE *fp1,*fp2; file://fp1为输入文件的指针,fp2为输出文件的指针rn  char c1, file://c1存放每次读取的字符rn  dest[100], file://dest存放完整的输出文件名及路径rn  dest1[9]; file://将j转换为字符串后,存放于dest1中rnrn  void takeout(); file://读取分析分隔特征串rn  void newfp2(); file://生成输出文件名rn  void initdest(); file://将dest和dest1中的元素全部清为'\x0'rn  void numtochar(); file://将j转换为字符串后,存放于dest1中rnrn  main()rn  rnrn  i=0,j=0;rn  if((fp1=fopen("d:\\net\\in.box","r"))==NULL)rn  rn  printf("Can't open d:\\net\\in.box");exit(1);rn  rn  c1=fgetc(fp1);rn  while(!feof(fp1))rn  rn  file://发现有分隔特征串的开头字符,则进入takeout()函数进行分析rn  if(c1=='\x10')rn  takeout();rn  file://生成输出文件名rn  newfp2();rn  if((fp2=fopen(dest,"w"))==NULL)rn  rn  printf("Can't open %s",dest);exit(1);rn  rn  file://没有到输入文件的结尾,又不是分隔特征串的开头字符,则将字符写入输出文件rn  while(!feof(fp1)&&((c1=fgetc(fp1))!='\x10'))rn  fputc(c1,fp2);rn  rn  return 0;rn  rnrn  void initdest()rn  rn  for(i=0;i=0&&j=10&&j=100&&j=1000&&j)rn  rn  c1=fgetc(fp1);rn  file://完全符合特征串,则当前邮件输出完毕,关闭输出文件rn  fclose(fp2);rn  rn  rnrn
谁帮帮忙把这段c语言代码变成java代码⋯⋯
⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯![图片说明](https://img-ask.csdn.net/upload/201605/29/1464504977_672654.png)
谁帮我把这段C代码转化为JAVA
void ui_mac_ntoa(const unsigned char *n, char *a, const char *d) rnrn rnrnsprintf(a, "%02x%s%02x%s%02x%s%02x%s%02x%s%02x", n[0], d, n[1], d, n[2], d, n[3], d, n[4], d, n[5]); rnrn rnrnrn//////mac -> 6 rnvoid ui_mac_aton(const char *a, unsigned char *n, const char *d) rnrn rnrnchar buf[30] = 0; rnrnconst char *upper = buf; rnrnchar ch[3] = 0; rnrnint nf = 0, ns = 0, nt = 2 + strlen(d); rnrnrnrnstrcpy(buf, a); rnrnui_strupper(buf); rnrnrnrnfor (unsigned int index = 0; index < 6; index++) rnrnstrncpy(ch, upper + index * nt, 2); rnrnrnrnnf = (ch[0] >= '0' && ch[0] = '0' && ch[1] ) + 10; rnrnrnrn*(n + index) = (unsigned char)(nf * 16 + ns); rnrn rnrnrn
谁能帮我把这段c代码转成DELPHI?
DWORD thisbase=*(PDWORD)ABCrnfor (int i=0;i<0x3E8;i++) rn rn DWORD mbase = *(DWORD *)(0x4C8 * i + thisbase + 0x4B8); rn if (mbase) rn rn //执行 rn else rn rn mbase=0; rn continue; rn rn rn谢谢!rnrn我对c不感冒,谢谢多才多艺的你~
这段VBA代码如何转换成VB.NET
RTrnrnVBA<em>代码</em>如下:rnrn[code=VB]rnSub Macro1()rnrn With ActiveChartrn .Axes(xlCategory, xlPrimary).HasTitle = Truern .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "日付"rn .Axes(xlValue, xlPrimary).HasTitle = Truern .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "障害件数"rn End WithrnrnEnd Subrn[/code]rnrn<em>转换成</em>VB.NET<em>代码</em>应该怎样写呢?
这段C#代码如何转换成vb.net?
网络上的转换工具都转换不了<em>这段</em><em>代码</em>rnrn//定义rn Public Delegate Sub BeginRequestHandler(ByVal request As System.Net.HttpWebRequest)rn Public Event BeginRequest As BeginRequestHandlerrnrn//要转换的语句rn HttpUtils.HttpWebRequest.BeginRequestHandler temp = new HttpUtils.HttpWebRequest.BeginRequestHandler(request=>rn request.Referer = string.Format("0/Login.aspx", url);rn );rnrn HttpRequest.BeginRequest += temp;rnrn最主要这个request=>是什么意思?
Delphi的这段代码如何转换成VBS?
[code=Delphi(Pascal)]rnfunction lbEncrypt(const S: String; Key: Word): String;rnvarrn I : Integer;rnbeginrn Result := S;rn for I := 1 to Length(S) dorn beginrn Result[I] := char(byte(S[I]) xor (Key shr 8));rn Key := (byte(Result[I]) + Key) * 129114 + 411921;rn if Result[I] = Chr(0) thenrn Result[I] := S[I];rn end;rnend;rn[/code]rnrn我目前<em>转换成</em>:rn[code=VBScript]rnfunction encpass(pwd,key)rn mystr=""rn for i=1 to len(pwd)rn j=Asc(mid(pwd,i,1)) xor shr(key,8)rn tempstr=chr(j)rn key=(asc(tempstr) + key) * 129114 + 411921rn if tempstr=chr(0) then tempstr=Mid(pwd,i,1)rn mystr=mystr&tempstrrn next rnend functionrn[/code]rnrn现在就发生问题了:rndelphi中的shr算术右移<em>如何</em>实现?
请高手 帮忙把这段vb.net 代码转换成 c# 代码
''' rn ''' 获取或设置所有数据权限rn ''' rn ''' 用户名rn ''' 数据权限类型rn ''' rn ''' rn ''' rn Public Property AllPower(ByVal cUserName As String, ByVal cDataPowerType As String, Optional ByVal cmd As System.Data.Common.DbCommand = Nothing) As Booleanrn Getrn Dim cClass As String = "数据权限"rn Dim cVarName As String = cUserName & "_" & cDataPowerTypern Dim Value As String = DAL.Var.Var.Create.getValue(cClass, cVarName, cmd)rn If tostr(Value) = "" Or tostr(Value) = "1" Thenrn Return Truern ElseIf tostr(Value) = "0" Thenrn Return Falsern End Ifrn End Getrn Set(ByVal value As Boolean)rn Dim cClass As String = "数据权限"rn Dim cVarName As String = cUserName & "_" & cDataPowerTypern Dim cValue As String = IIf(value, "1", "0")rn DAL.Var.Var.Create.Save(cClass, cVarName, cValue, cmd)rn End Setrn End Propertyrn End Class
请问这段JAVA代码如何转换成C++代码
[code=Java]rnString getCRC(byte[] arg) rnint i, accumulator, data, index;rnString returnValue = new String();rnaccumulator = 0xffff;rnfor (i=0; i> 8) ^ data;rnaccumulator = (accumulator << 8) ^ this.crcTable[index];rnrnaccumulator ^= 0xffff;rnreturnValue = Integer.toHexString(accumulator).toUpperCase();rnfor (i=returnValue.length(); i + returnValue;rnreturn returnValue;rn[/code]rnrn<em>转换成</em>C++的<em>代码</em>不是到byte[]数组应该替换成什么数组,如果替换成BYTE数组,就会出错,谢谢先~
哪位能帮帮忙把这段Delphi 代码 转换成 c# 代码
Procedure DiscoverSomethingInteresting(Input : Array Of Integer; Out x, y, z : Integer);rnVarrn i, j, k : Integer;rn w : Integer;rnBeginrn z := -MaxInt;rn For i := 1 To Length(Input) Dorn Beginrn For j := 0 To Length(Input) - i Dorn Beginrn w := 0;rn For k := 0 To i - 1 Dorn Beginrn w := w + Input[j+k];rn End;rn If w > z Thenrn Beginrn z := w;rn x := j;rn y := j+i-1;rn End;rn End;rn End;rnEnd;rn-------------------------rn一道面试的题是用Delphi 写的。 我只学过 c# 和php 哪位学过Delphi 能帮我把<em>代码</em><em>转换成</em>c# 的。题目中说<em>代码</em>中有逻辑错误,哪位看出来了能不能指点一下!rn先谢谢各位 了。。。。。。。
请高手帮我把这段vb代码转换成c#代码
Private Function LShift(lValue, iShiftBits)rnIf iShiftBits = 0 ThenrnLShift = lValuernExit FunctionrnElseIf iShiftBits = 31 ThenrnIf lValue And 1 ThenrnLShift = &H80000000rnElsernLShift = 0rnEnd IfrnExit FunctionrnElseIf iShiftBits < 0 Or iShiftBits > 31 ThenrnErr.Raise 6rnEnd IfrnrnIf (lValue And m_l2Power(31 - iShiftBits)) ThenrnLShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000rnElsernLShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))rnEnd IfrnEnd Function
哪位大虾把这段VB代码转换成C#代码
Dim fDoc As HTMLDocumentrn Dim fra As HTMLFrameElementrn Dim frawnd As HTMLWindow2rn Dim x As Integerrnrn Set fDoc = WebBrowser1.Documentrn ' Loop through the frames.rn If fDoc.frames.length <> 0 Thenrn For x = 0 To fDoc.frames.length - 1rn [color=#FF0000]Set frawnd = fDoc.frames.Item(x)[/color]rn Set fra = frawnd.frameElementrn Debug.Print fra.srcrn Next xrn End Ifrnrn Set fDoc = Nothingrn Set frawnd = Nothingrn Set fra = NothingrnrnrnSet frawnd = fDoc.frames.Item(x)这句我看不懂啊,左边是HTMLWindow2类型,右边是frame类型,这叫什么转换呀??rnrn
求助高手帮我把这段httpd.in代码转换成.htaccess代码
[ISAPI_Rewrite]rnCacheClockRate 3600rnrnRepeatLimit 32rnrnrnRewriteRule /category/index.html /category\.phprnRewriteRule /category/([0-9]+).html /category\.php\?catid=$1rnRewriteRule /category/([0-9]+)-([0-9]+)\.html /category\.php\?catid=$1&page=$2rnRewriteRule /product/(.+)-(.+)\.html /view\.php\?nick=$1&iid=$2rnRewriteRule /tag/(.*)-([0-9]+)\.html /tag\.php\?q=$1&page=$2rnrnRewriteRule /tag/(.*)\.html /tag\.php\?q=$1&page=1rnrn感激不尽!
帮忙把这段pascal翻译成c程序
偶没学过pascal 看不懂rnrntypern by200=record 建立数组Drn da:array[1..200,1..200] of byte;rn end;rn ds1=record ds1:用于存放任务数据(单个任务)的数据类型rnst:string; 字符串变rn word:array[1..20] of string; 单词数组rn m:integer; 单词个数rn k:integer; 分为k份rn end;rn ds=record ds:用于存放所有任务数据的数据类型rn n:integer; 任务个数rn da:array[1..6] of ds1; 任务数据rn end;rnvarrn i,j,max,a,a1,b,c,d,e,f:integer;rn dt,p:^by200; 建立数组Drn dat:array[1..3] of ^by200; 建立数组Drn lo:ds; lo: 用于存放任务数据rn t:boolean;rn st:string;rn labels:array[1..200] of byte; labels:用于存放查找到的单词长度rnprocedure loadfile(sn:string); 读文件的过程rnvarrn fi:text;rn t1,t2,t3,t4,t5,t6:integer;rn st1:string;rnbeginrn assign(fi,sn);rn reset(fi);rn readln(fi,lo.n);rn for t1:=1 to lo.n dorn beginrn readln(fi,t2,lo.da[t1].k);rn for t3:=1 to t2 dorn beginrn readln(fi,st1);rn lo.da[t1].st:=lo.da[t1].st+st1;rn end;rn readln(fi,t2);rn lo.da[t1].m:=t2;rn for t3:=1 to t2 dorn readln(fi,lo.da[t1].word[t3]);rn end;rn close(fi);rnend;rnrnbeginrn writeln;rn readln(st);rn writeln('Open File : ',st);rn loadfile(st);rn for a:=1 to 3 dorn new(dat[a]); 建立数组Drn for a:=1 to lo.n dorn beginrn for i:=1 to lo.da[a].m-1 dorn for j:=i+1 to lo.da[a].m dorn if lo.da[a].word[i][0]>lo.da[a].word[j][0] then 首先对单词进行排序,使单词的长度由小到大排列。rn为了保证程序算出的是最优值,长度较小的单词将优先处理rn beginrn st:=lo.da[a].word[i];rn lo.da[a].word[i]:=lo.da[a].word[j];rn lo.da[a].word[j]:=st;rn end;rn for i:=1 to 200 dorn labels[i]:=255;rn f:=length(lo.da[a].st); f是字符串的长度rn for i:=1 to lo.da[a].m dorn beginrn c:=length(lo.da[a].word[i]);rn for j:=1 to f-c+1 dorn if (labels[j]=255) and (copy(lo.da[a].st,j,c)=lo.da[a].word[i]) thenrn labels[j]:=c; labels[j]表示首字母占用字符串中第j个位置的单词的长度rn end;rn for j:=1 to f dorn beginrn d:=0; d用于计算D(i,j,1)rn for i:=j downto 1 dorn beginrn if labels[i]max then max:=e; 计算MAX(D(b,d,a)+D(d+1,c,a))rn end;rn dat[j]^.da[b][c]:=max;rn end;rn end;rn if lo.da[a].k=1 then j:=1;rn writeln(dat[j]^.da[1][f]);rn end;rn writeln;rnend.rnrnrn或者说说<em>这段</em>程序的算法也可以
怎么样把这段C程序改成Delphi的?
我想通过一个窗口发消息到另一个窗口,把字符串指针传给另一个窗口rnrn///////////////////////////////////////rn发送端rnchar *str;rnSendMessage(hWnd, WM_USER, 0, (LPARAM)str);rnrn接受端rnOn_WM_Userrnrnchar *str;rnstr = (char*)lParam;rnrn///////////////////////////////////////rn这样我就可以取得str的字符串内容了,可是在delphi中我该怎么写?
蛙蛙请教:把一段c算法代码转换成c#代码
蛙蛙请教:把一段c算法<em>代码</em><em>转换成</em>c#<em>代码</em>。rn这是一段剪贴板的数据转换算法<em>代码</em>,请帮忙把UTF8ToHtml<em>转换成</em>c#<em>代码</em>,我转了一下,根本不能用。rn再帮忙写下注释,简单说一下原理,谢谢。rn原文如下:rnI was working on a project where I had to paste into textbox HTML, copied from the Browser. A quick search on "HTML Clipboard Format" in MSDN gives you an article that thoroughly explained how HTML is kept in the Clipboard. Unfortunately, this article tells you that it's kept in UTF-8 format without explaining how to convert from UTF-8 back to HTML. So I had do some research on my own.rnrnUTF-8 is the format that allows using Unicode characters in ASCII text by embedding a special token, &#code;, into the text, where the code is Unicode code (in decimal format) for the symbol. For some symbols there are special names. An example " " is " "... You can jump to the specification if you need more examples.rnrnHere is a UTF8ToHtml function, which converts from UTF-8 to HTML. The algorithm is not explained, but you can read more about it here.rnrn//utf8 - pointer to UTF8 formatted text. dwSize - size of UTF8 text; ptr is the pointer to Output buffer.rnrn//The OnClickedPastehtml is the handler for BN_CLICK event of the button in Dialog box. IDC_TEXT is the multiline text box.rnrnrnvoid UTF8ToHtml(BYTE *utf8, DWORD dwSize, CHAR *ptr )rnrn int code;rn BYTE *end = utf8 + dwSize;rn while( utf8 < end )rn rn code = 0;rn if( (*utf8 & 0xF0) == 0xF0 )rn rn code = (((*utf8)&0x0F) << 18) | (((*(utf8+1))rn & 0x7F)<<<< 12) | (((*(utf8+1))rn & 0x7F)<<< 6) | ((*(utf8+1)) & 0x7F) ;rn utf8+=1;rn rn rn rnrnrn if( code == 0 )rn rn *ptr = *utf8;rn rn elsern rn char s[10];rn switch(code)rn rn case 160:rn strcpy(s, "& ");rn break;rn case 34:rn strcpy(s, "&");rn break;rn case 36:rn strcpy( s, "&&");rn break;rn case 60:rn strcpy( s, "&");rn break;rn default:rn sprintf( s, "&#%d;", code );rn break;rn rn strcpy( ptr, s );rn ptr += strlen(s)-1;rn rn utf8++;rn ptr++;rn rn *ptr = 0;rnrnLRESULT CDialog::OnClickedPastehtml( WORD wNotifyCode,rn WORD wID,rn HWND hWndCtl,rn BOOL& bHandled)rnrn if (!OpenClipboard() )rn return 0;rn UINT uHtmlFormat = RegisterClipboardFormat("HTML Format");rn UINT uFormat = uHtmlFormat;rn if( IsClipboardFormatAvailable( uHtmlFormat ) == FALSE )rn rn if( IsClipboardFormatAvailable( CF_TEXT ) == FALSE )rn return 0;rn uFormat = CF_TEXT;rn rnrn HGLOBAL hglb;rn LPTSTR lptstr;rn hglb = GetClipboardData(uFormat);rn if (hglb != NULL)rn rn lptstr = (LPTSTR)GlobalLock(hglb);rn if (lptstr != NULL)rn rn char *ptr1 = strstr( lptstr, "");rn if( ptr1 != 0 )rn rn ptr1 += 20;rn char * ptr2 = strstr( lptstr, "");rn int iSize = (ptr2 - ptr1);rn char * tmp = (char*)_alloca( iSize *2);rn UTF8ToHtml((BYTE*)ptr1, iSize, tmp );rn //memcpy(tmp, ptr1, iSize );rn //tmp[iSize] = 0;rn SetDlgItemText(IDC_TEXT, tmp );rn rn elsern SetDlgItemText(IDC_TEXT, lptstr );rn GlobalUnlock(hglb);rn rn rn CloseClipboard();rn return 0;rnrn这是我转换的<em>代码</em>rnprivate void FTopMost_DragDrop(object sender, DragEventArgs e)rnrn strCont = e.Data.GetData(DataFormats.Html, true).ToString();rn int start = strCont.IndexOf("");rn int end = strCont.IndexOf("");rn string s = strCont.Substring(start + 20, end - start - 20);rnrn FNewPost f = new FNewPost();rn f.HTML = UTF8ToHtml(s);rn f.Show();rn f.Activate();rnrnstring UTF8ToHtml(string utf8)rnrn string ptr = null;rn int code;rn for (int i = 0; i < utf8.Length; i++ )rn rn code = 0;rn if ((utf8[i]) == 0xF0)rn rn code = (((utf8[i]) & 0x0F) << 18) | ((((utf8[i] + 1)) & 0x7F) << 12) | ((((utf8[i] + 2)) & 0x7F) << 6) | (((utf8[i] + 3)) & 0x7F);rn i += 3;rn rn elsern rn if ((utf8[i]) == 0xE0)rn rn code = (((utf8[i]) & 0x1F) << 12) | ((((utf8[i] + 1)) & 0x7F) << 6) | (((utf8[i] + 2)) & 0x7F);rn i += 2;rn rn elsern rn if ((utf8[i]) == 0xC0)rn rn code = (((utf8[i]) & 0x3F) << 6) | (((utf8[i] + 1)) & 0x7F);rn i += 1;rn rn rn rnrn if (code == 0)rn rn ptr += utf8[i];rn rn elsern rn string s = null;rn switch (code)rn rn case 160:rn s = "& ";rn break;rn case 34:rn s = "&";rn break;rn case 36:rn s = "&&";rn break;rn case 60:rn s = "&";rn break;rn default:rn //sprintf( s, "&#%d;", code );rn s = "&" + code.ToString();rn break;rn rn ptr += s;rn rn rn return ptr;rnrn这是一段剪贴板数据,当然这里没有中文rnVersion:0.9rnStartHTML:71rnEndHTML:170rnStartFragment:140rnEndFragment:160rnStartSelection:140rnEndSelection:160rnrnrnrn The HTML Clipboardrn rnrnrnrn The Fragmentrnrnrn
请大虾们把C/C++代码转换成C#,谢谢
bool checkhu1(vMjpai T)rn rn sort(T.begin(),T.end());rn //11,123,123,123,123rnrn //如果只剩2个将,其他就都碰或吃了相等就胡了rn unsigned int usize = T.size();rnrnrn if (! (usize ==2|| usize ==5||usize ==8||usize ==11||usize ==14) )rn rn return false;rn rnrn /*rn for (unsigned j=0;j
各位帮我把下面的C/C++代码转换成C#,多谢
bool checkhu1(vMjpai T)rn rn sort(T.begin(),T.end());rn //11,123,123,123,123rnrn //如果只剩2个将,其他就都碰或吃了相等就胡了rn unsigned int usize = T.size();rnrn if (! (usize ==2|| usize ==5||usize ==8||usize ==11||usize ==14) )rn rn return false;rn rnrn /*rn for (unsigned j=0;j
QT c语言中的结构体如何转换成c++中的类
typedef struct Signalrnrn QString Name;rn unsigned int ByteIndex;rn unsigned int BitNo;rn unsigned int length;rn QString Type;rn QString MaxVal;rn QString MinVal;rn float Offset;rn float ScaleFac;rn QString Unit;rn QString Order;rnSignal;rnrntypedef struct Messageinfornrn QString MessageName;rn QString MessageID;rn QString MessageLength;rn QString FrameFormat;rn unsigned int NumberSignals;rn QString DataFormat;rn Signal signal[32];rnMessageinfo;rn<em>如何</em>用<em>qt</em>中的Qlist窜起来,可以创建多个Message对象,Message里又可以new多个Signalrn
转换成c:\\abc">怎么把字符串"c:\abc"用函数转换成c:\\abc
我用String a="c:\abc"rn a.replaceAll("\\","\\\\")这样不行的??
把C代码改成C#
char[] str=new char[char.MaxValue];rnchar[] tmp=new char[char.MaxValue];rnint i;rnConsole.WriteLine("Please input number bunch: ");rnstr=Console.ReadLine().ToCharArray();rntmp[key_id++]=str[0];rnfun(tmp,str);rnrnrnfun(char *tmp,char *str)rnrn int i,j;rn if(strlen(tmp)==strlen(str))rn rn printf("\n%s",tmp);rn return;rn rn for(i=0;i
怎么把c语言转换成汇编?
rt,谢谢~!
c中怎样把十进制数转换成十六进制?
rt
在c中怎么把数字转换成字符串
atoi对应的函数是什么?
请问怎么把Fortrain转换成C?
我有个Fortrain写的算法,用到了Fortrain里面的库函数(二次凸规划),现在要把这个算法镶在C里面(VC开发),请问有可行性吗?可以的话我该怎么做?谢谢!rn
求C代码改成MFC代码!!
#include rn#include rn#include rn#include rn#define MAX_INDEX 100rnrnvoid swap(int *a,int *b)rnrn int t;rn t=*a;rn *a=*b;rn *b=t;rnrnrn/*快速排序算法*/rnvoid QuickSort(int a[], int l, int r)rnrnrn int i=l; /*从左至右的游标*/rn int j=r+1; /*从右到左的游标*/rn int pivot=a[l];rn if (l >= r) return;rn /*把左侧>= pivot的元素与右侧= pivot 的元素*/rn i = i + 1;rn while (a[i] < pivot);rn dorn /*在右侧寻找 pivot);rn if (i >= j) break; /*未发现交换对象*/rn swap(&a[i],&a[j]);rn rnrn /*设置p i v o t*/rn a[l] = a[j];rn a[j] = pivot;rn QuickSort(a, l, j-1); /*对左段排序*/rn QuickSort(a, j+1, r); /*对右段排序*/rnrnrnrnvoid Huanf(int Array[][MAX_INDEX],int n)rnrn int i,j;rn int a,b,m;rn int tempArray1[MAX_INDEX];rn int tempArray2[MAX_INDEX];rn a=n/2;rn b=a+1;rn m=n%4;rn switch(m)rn rn case 0:rn case 2:rn /*穿心对调*/rn for(i=0;in/2)rn rn if(i%2==1&&Array[i][j]%2==0)/*偶行换偶*/rn rn swap(&Array[i][j],&Array[n-1-i][n-1-j]);rn rn else if(i%2==0&&Array[i][j]%2==0)/*奇行换奇*/rn rn swap(&Array[i][j],&Array[n-1-i][n-1-j]);rn rn rn rn /*End穿心对调*/rn /*重排米字*/rn for(i=0;i
qt 如何调用c函数
many opensource code is in c code format for most wide use. <em>qt</em> uses c++. so use c function is the same as common C++ and C program. c functions and var to be called by c++ should be in a header file
这段代码怎么转换成vb
function RenderTxt(text:string; //将要写在位图画布(CANVAS)上的文字串rn bmp:Tbitmap; //目标位图rn x1,y1,x2,y2:integer; //目标区域坐标(注意必须X10表示目标区域最大能容纳的字符数。rn Tx,Ty,i,L,fw,fh:integer;rn s:string[2];rnbeginrn result:=-1;rnrn tryrn with bmp.Canvas dorn beginrn font.Name:=fontname;rn font.Size:=fontsize;rn font.Color:=fontcolor;rn end;rnrn fh:=bmp.Canvas.TextHeight('0123456789ABCxyz_Text Sample');rnrn Tx:=x1;Ty:=y1;rn i:=1;L:=length(text);rn while(i$A0 then s:=copy(text,i,2);rn fw:=bmp.Canvas.TextWidth(s);rn if Tx+fw>x2 thenrn beginrn Tx:=x1;Ty:=Ty+fh+LineStep;rn if Ty>y2 then break;rn end;rn Bmp.Canvas.TextOut(Tx,Ty,s);rn Tx:=Tx+fw;i:=i+Length(s);rn end;rn result:=i;rn exceptrn elsern end;rnrnend;
这段c代码是什么意思 c primer plus里的
是c primer c里面的 ,第2个 if 和第三个 if不懂rnrn rnrn#include rn#include rnrn#define STOP '|'rnrnint main(void)rnrn char c; //读入字符rn char prev; //前一个读入字符rn long n_chars = 0L; //字符数rn int n_lines = 0; //行数rn int n_words = 0; //单词数rn int p_lines = 0; //不完整的行数rn int inword = 0; //如果c在一个单词中,则inword等于1rnrn rnrn printf ("Enter text to be analyzed (exit to terminate): \n");rn prev = '\n';rnrn rnrn while ( (c = getchar () ) != STOP)rn rn n_chars++; //统计字符rnrn rnrn if ( c == '\n' )rn n_lines++; //统计行rnrn rnrn if ( !isspace (c) && !inword ) rn rn inword = 1; //开始一个新单词rn n_words++; //统计单词rn rnrn rnrn if ( isspace (c) && inword )rn inword = 0; //到达单词的尾部rnrn rnrn prev = c; //保存字符值rn rnrn rnrn if ( prev != '\n' )rn p_lines = 1;rnrn rnrn printf ("charcters = %ld .words = %d, lines = %d." ,n_chars ,n_words,n_lines);rnrn printf ("partial lines = %d\n" ,p_lines);rnrnrn return 0;rnrnrn
哪位可以把这段C#代码转为MFC代码
const string KEY_64 = "k123*&^%";rn const string IV_64 = "k123*&^%"; //注意了,是8个字符,64位 rnrn rnrn public string Decode(string data)rn rn byte[] byKey = System.Text.ASCIIEncoding.ASCII.GetBytes(KEY_64);rn byte[] byIV = System.Text.ASCIIEncoding.ASCII.GetBytes(IV_64);rnrn byte[] byEnc;rn tryrn rn byEnc = Convert.FromBase64String(data);rn rn catchrn rn return null;rn rnrn DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();rn MemoryStream ms = new MemoryStream(byEnc);rn CryptoStream cst = new CryptoStream(ms, cryptoProvider.CreateDecryptor(byKey, byIV), CryptoStreamMode.Read);rn StreamReader sr = new StreamReader(cst);rn return sr.ReadToEnd();rn
帮忙看看为什么这段C代码运行报错?
#includern#includernrnvoid main()rnrn FILE *fp;rn double d = 23.31;rn int i = 13;rn long li = 1234567L;rnrn if((fp = fopen("jak","wb+")) = NULL)rn rn printf("文件打开失败");rn exit(1);rn rn rn fwrite(&d,sizeof(double),1,fp);rn fwrite(&i,sizeof(int),1,fp);rn fwrite(&li,sizeof(long),1,fp);rnrn fclose(fp);rnrn if((fp = fopen("jak","rb+")) = NULL)rn rn printf("文件打开失败");rn exit(1);rn rnrn fread(&d,sizeof(double),1,fp);rn fread(&i,sizeof(int),1,fp);rn fread(&li,sizeof(long),1,fp);rnrn printf("%f,%d,%ld",d,i,li);rn fclose(fp);rn
请帮我解释以下这段C代码
一段泊松<em>代码</em>内容如下:rnstatic long poisson(long * seed, long mean)rnrn long n;rn double p,q;rn double exp();rn n = 0;rn q = -(double)mean;rn p = exp(q);rn q = uniform(seed,0,1); /* 生成(0, 1]均匀分布的随机值 */rn while(p < q) rn n++;rn q = uniform(seed,0,1) * q;rn rn return(n);rnrnrn我的理解为,不停的生辰随机值,把这些随机值累乘,知道累乘的结果小于-e^(mean)为止。然后返回这些随机值的个数。rnrn问题是,泊松的公式不是 P=(λ^k)*e^(-λ)/k! 吗?上面的<em>代码</em>是怎么和理论公式统一的呢?rn实在是想不通啊!还望高手解答。
求高手解释下这段C代码
#include rn#include rnmain()rnrn static int a[34];rn int i,j,k,c=0;rn a[0]=1;rn k=0;rn for(i=1;i=0;k--) rn printf("%d",a[k]);rn printf("\n");rn getch();rn return 0;rnrn它就是求7的34次方,但我看不懂,
C语言,这段代码是什么问题啊?
#include n#include n#include ntypedef struct nn char name[20];n int age;ninfo;nvoid getinfo(info*pinfo) nn printf("请输入姓名:\n");n gets(pinfo->name);n printf(" 请输入年龄:\n");n scanf("%d",&pinfo->age);nnnvoid main(void)nn info people[100];n char FileA[50];n printf("保存在哪个文件?\n");n gets(FileA);n FILE*fpo=NULL;n fpo=fopen(FileA,"wt");n if(fpo==NULL)n n printf("输出文件打开失败,请检查\n");n exit(0);n n for (int i=0;i);n fclose(fpo);n getch();nnn![图片说明](https://img-ask.csdn.net/upload/201601/20/1453241934_293665.png)n在循环的时候,直接跳到输入年龄哪里了?这怎么回事啊.
数字图像处理论文(基于小波变换的图像压缩)下载
数字图像处理论文(基于小波变换的图像压缩)数字图像处理论文(基于小波变换的图像压缩)数字图像处理论文(基于小波变换的图像压缩)数字图像处理论文(基于小波变换的图像压缩) 相关下载链接:[url=//download.csdn.net/download/wutao22/2855936?utm_source=bbsseo]//download.csdn.net/download/wutao22/2855936?utm_source=bbsseo[/url]
数据结构 表达式求值算法下载
严蔚敏数据结构 表达式求值 c语言实现 符号优先级 相关下载链接:[url=//download.csdn.net/download/wanyan1992/3251708?utm_source=bbsseo]//download.csdn.net/download/wanyan1992/3251708?utm_source=bbsseo[/url]
C#导入导出Excel相关资料(各类方法总结)下载
CS导出Excel总结,CS导出Excel总结,CS导出Excel总结 相关下载链接:[url=//download.csdn.net/download/muyao520/4117417?utm_source=bbsseo]//download.csdn.net/download/muyao520/4117417?utm_source=bbsseo[/url]
我们是很有底线的