易截截图软件、单文件、免安装、纯绿色、仅160KB

C/C++/VC 实现字符串逆转的多种方法

/加了下面两个头文件,是为了在Win32工程中使用MFC的特性!
#include <afx.h>
#include <afxwin.h>
#include "stdio.h"
#include "conio.h"
////加了下面两句,是为了能够用string(basic_string类型)
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
// string  _strtemp = "1111";
// TRACE("\n string = %s \n",_strtemp.c_str() );
// printf("\n string = %s \n",_strtemp.c_str() );
// printf("\n Hello World! \n");
// getch();
 CString  sTemp;
 sTemp.Format("jkgja");
 AfxMessageBox(sTemp);
 return 0;
}
/************************************************************************/
/*     实现字符串逆转                                      */
/************************************************************************/
/////方案一 用纯C函数实现
/*#include <iostream>
#include <string>
using namespace std;
int main()
{
    string str = "abcdefghijklmn";
 cout<<str.c_str()<<endl;
    cout<<strrev(strdup(str.c_str()))<<endl;
 system("pause");
 return 0;
}*/
///// 方案二 用STL函数实现
// reverse_copy.cpp
// compile with: /EHsc
// Illustrates how to use the reverse_copy function.
//
// Functions:
//    reverse_copy - Reverse a sequence, copy the results to another
//                   same-sized sequence.
//
//////////////////////////////////////////////////////////////////////
/*
// disable warning C4786: symbol greater than 255 character,
// okay to ignore
#pragma warning(disable


相关文档:

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 ......

java调用C/C++写的dll

Java语言本身具有跨平台性,如果通过Java调用DLL的技术方便易用,使用Java开发前台界面可以更快速,也能带来跨平台性。
Java调用C/C++写好的DLL库时,由于基本数据类型不同、使用字节序列可能有差异,所以在参数传递过程中容易出现问题,DLL中可能需要做相应的转换。
使用Java调用DLL动态链接库的方案通常有三种:JNI, Ja ......

C/C++经典排序算法

排序算法是一种基本并且常用的算法。由于实际工作中处理的数量巨大,所以排序算法对算法本身的速度要求很高。
    而一般我们所谓的算法的性能主要是指算法的复杂度,一般用O方法来表示。在后面我将给出详细的说明。
    对于排序的算法我想先做一点简单的介绍,也是给这篇文章理一个提纲 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号