How can I make it a global arrays of objects, like QPoint point[5][6];
global.h
#include <QPoint>
extern QPoint point[5][6];//Am I correct?
global.cpp
#include <global.h> // How to initialize???
main.cpp
#include <global.h>
use them;
How can I make it a global arrays of objects, like QPoint point[5][6];
global.h
#include <QPoint>
extern QPoint point[5][6];//Am I correct?
global.cpp
#include <global.h> // How to initialize???
main.cpp
#include <global.h>
use them;
全球人是邪恶的。las,惯用的方法是:
global.h
#ifndef BENHUAN_GLOBAL_H_INCLUDED
#define BENHUAN_GLOBAL_H_INCLUDED
#include <QPoint>
extern QPoint point[5][6]; // declaration
#endif
global.cpp
#include "global.h'
QPoint point[5][6]; // definition
main.cpp
#include "global.h"
...
point[1][2] = QPoint(5,6);