-2
我聲明瞭一個我寫在我的主文件中的類,因爲我最需要它。你看到我定義的類Sock sock = new Sock();在主文件中使用定義的類
#include "stdafx.h"
#include <iomanip>
#define TEST "test"
using namespace std;
using namespace cv;
Sock *sock = new Sock();
int main()
{
Mat image;
Mat mbuffer;
VideoCapture capture;
uint8_t bytes[11];
所以現在我需要另一個函數這個類,女巫是在另一個文件中,以保持主文件乾淨,易於閱讀。但是我不能公開它,襪子也不被認可。我可以在我的類聲明下寫一個函數。有沒有辦法在每個文件中使用聲明的類?
它不是很清楚,如果你的意思是類'Sock'或實例'sock' – user463035818