0
我正在試圖從一本書的示例代碼中獲得幫助,因此我不完全確定我到目前爲止在頭文件中可能有哪些錯誤。錯誤C2504:'ios':base class undefined
我不斷收到以下錯誤消息。
錯誤2錯誤C2061:語法錯誤:識別符 '流緩衝'
錯誤1個錯誤C2504: 'IOS':基類未定義
錯誤5智能感知:標識符 「流緩衝」 是未定義
// StdAfx.h HEADER FILE
**************************
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include <iostream>
#include <strstream>
#include <iomanip>
#include <ios>
#include <stdio.h>
#include <tchar.h>
#include "targetver.h"
// Conios HEADER FILE
**************************
#include "Stdafx.h"
class Conios :virtual public ios{
protected:
public:
Conios(void);
~Conios(void);
Conios(streambuf* Buffer);
};
工作正常!謝謝。 – Kobojunkie 2011-12-24 06:50:34
建議他使用'use namespace std;'是非常糟糕的建議。更好的建議是告訴他不要**使用它。 – Nawaz 2011-12-24 07:05:00
@Nawaz:你說得對,我在我的回答中加入了(但是在實現文件中使用'namespace'被接受,不是嗎?)。 – vstm 2011-12-24 07:32:21