2016-03-07 61 views
-1

此行中可能出现的错误是什么?nearPoint之前的预期初始化程序

const SPoint nearPoints[iloscKierunkow] = {SPoint(0, -1), SPoint(1, 0), SPoint(0, 1), SPoint(-1, 0)}; 

我的NearPoint

Sorounding代码之前得到

错误预期初始化是

static const int TU_JESTEM = '+'; 
static const int NIE_BADANY = ' '; 
static const int ZBADANY = '*'; 

const int iloscKierunkow = 4; 
const int SPoint nearPoints[iloscKierunkow] = {SPoint(0, -1), SPoint(1, 0), SPoint(0, 1), SPoint(-1, 0)}; 

class Punkt 
{ 
public: 
    int x, y; 

    Punkt(int Nx = 0, int Ny = 0) 
    {//konstruktor 
     x = Nx; 
     y = Ny; 
+0

是'SPoint'一些类别处定义? – molbdnilo

回答

1
const int SPoint nearPoints[iloscKierunkow] = {SPoint(0, -1), SPoint(1, 0), SPoint(0, 1), SPoint(-1, 0)}; 

宣布其类型为int和再SPOINT。我猜你的意思是:

const SPoint nearPoints[iloscKierunkow] = {SPoint(0, -1), SPoint(1, 0), SPoint(0, 1), SPoint(-1, 0)}; 
+0

AAA是sory那里应该没有int不知道它是如何来到那里,但仍然错误保持不变 – Bulit

+0

一旦你摆脱了'int'它对我来说看起来很好。我在gcc中测试了一个虚拟SPoint类,它编译得很好。您是否在此行之前定义了SPoint? –

+0

确定即时通讯如此愚蠢真的赫赫我只是解决这个问题Jarra McIntyre这是当你从其他类复制代码会发生什么; p hehe – Bulit

0

看看吧:

const int SPoint nearPoints[iloscKierunkow] 

'廉政' 是不必要在这里

相关问题