代码搜索结果
找到约 10,000 项符合
C++ 的代码
c++
// Example of the friend class
#include
//定义YourClass类,
class YourClass
{
//指定YourOtherClass是它的友元类
friend class YourOtherClass;
private:
int num;
public:
YourClass(int
c++
#include
#include
//main()函数
void main( void )
{
//声明字符数组
char string[80],*p;
//输入字符串并将其反转
coutstring;
p=strrev(string );
c++
#include
#include
#include
using namespace std;
//创建map的实例,整数(int)映射字符串(string)
typedef map INT2STRING;
//测试map容器
void main()
{
//创建map对象theMa
c++
#include
#include
//main()函数
void main( void )
{
//声明字符数组
char string[]="This is a test.";
int n;
//获得字符串的长度
cout
c++
#include
main()
{
//按位与运算
cout
c++
#include
#include
#include
#define ARRAY_SIZE 10
using namespace std;
//利用类模板生成实例
typedef vector < int > IntArray;
//显示数组
void put_array(int x[],int size) {
c++
#include
main()
{
//输出字符串
printf("He said \"Hello!\"");
//输出各进制整数
int i=64;
printf("\ni=%d",i); //以十进制格式输出
printf("\ni=%o",i); //以八进制格式输出
c++
#include
main()
{
//变量声明
char c;
double x,y;
//测试自增
cout
c++
#include
//基类First
class First {
int val1;
public:
SetVal1(int v) {
val1=v;
}
void show_First(void) {
cout
c++
#include
//add()函数的定义,其有返回值
double add(double x,double y)
{
double z;
z=x+y;
cout