#include<iostream>
#include<string>
using namespace std;
class Str
{
int length;
char *p;
public:
Str()
{
p=new char[100];
}
Str(char *s)
{
……继续阅读 »
9年前 (2016-04-17) 2528浏览
0个赞
正在学习用ffmpeg写一个播放器,但是学习到tutorial3的时候播放视频没有声音,大家看看哪里出了问题啊
// Tutorial.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
extern "C"
{
#include"libavcodec\avcodec.h"
#include"libavformat\avf……继续阅读 »
9年前 (2016-04-17) 1595浏览
0个赞
定义结构体在
typedef struct struKeyValue
{
char AppName[13];
char KeyName[13];
UINT nDefault;
};
const struKeyValue TBL_KV[] =
{
{ “PARAMS_Color”, “Area”, 100 },
……继续阅读 »
9年前 (2016-04-17) 1335浏览
0个赞
函数index(char s[],char t[])检查字符串s中能否包含字符串t,若包含,则返回t在s中的开始位置(下标值),否则返回-1。
index(char s[],char t[])
{
int i,j,k;
for(i=0;s[i]!=’\0’;i++)
{
for(j=i,k=0;填空1______&&s[j]==t[k];j+……继续阅读 »
9年前 (2016-04-17) 1248浏览
0个赞
template< template<class T> class T1 >
//这个类模板该怎么理解?
解决方案
3
以“有一个类型模板参数的模板”作为模板参数的模板
3
模板参数本身也是个模板,后者的模板参数是个普通的类类型。
21
http://stackoverflow.com/questions/6484484/templa……继续阅读 »
9年前 (2016-04-17) 991浏览
0个赞
#include <iostream>
using namespace std;
class fulei
{
public:
void fun1();
void fun2();
protected:
private:
};
class zilei:public fulei
{
public:
void fun3();
void fun4……继续阅读 »
9年前 (2016-04-17) 1155浏览
0个赞
本人在头文件中放了个函数,另外在源文件中编写了函数的实现方法,但是在主函数中进行调用该函数就提示了error LINK2019的问题,问一下这要怎么解决,在网络上搜要用lib也没有弄好。
sum.h文件
#ifndef SUM_H
#define SUM_H
int sum(int a,int b);
#endif
sum.cpp文件
#include……继续阅读 »
9年前 (2016-04-17) 1015浏览
0个赞
#include<iostream>
using namespace std;
class Array
{
protected:
int a[3][3];
public:
Array(){};
Array(int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8,int a9)
{
a[0][……继续阅读 »
9年前 (2016-04-17) 1073浏览
0个赞
当继承的时候,
虚函数表,应该已经出来了吧.
编译器应该很清楚全部父类和子类的虚函数的代码偏移地址.
所以类的虚函数表应该已经出来了啊.
唯一的就是对象创建的时候, 把指针 指向 虚函数表的线性地址.
编译后的汇编代码(子类的部分代码)
movl -4(%ebp), %eax
movl $__ZTV6Derive+8, (%eax)
movl -4(%ebp……继续阅读 »
9年前 (2016-04-17) 1275浏览
0个赞