행렬 오류에 대해서 여쭈어봅니다..
#include <cstdlib> #include <iostream> #include <conio.h> #include <windows.h> #include <gl/gl.h> #include <gl/glu.h> #include <gl/glut.h> #include <stdlib.h> #include <time.h> #include <math.h> #include <stdio.h> // ... // 생략 //.... Matrix::Matrix() { m[3][3] = { {1, 0, 0}, {0, 1, 0}, {0, 0, 1} };// 단위행렬 current_length = sizeof(m); }
물론 메인함수는 오류가 나지 않고 행렬에 대해서만 다음과 같은 오류가 납니다.
>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(5) : error C2059: 구문 오류 : '{'
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(5) : error C2143: 구문 오류 : ';'이(가) '{' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(6) : error C2143: 구문 오류 : ';'이(가) '}' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(6) : error C2143: 구문 오류 : ';'이(가) ',' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(7) : error C2143: 구문 오류 : ';'이(가) '{' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(7) : error C2143: 구문 오류 : ';'이(가) '}' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(7) : error C2143: 구문 오류 : ';'이(가) ',' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(8) : error C2143: 구문 오류 : ';'이(가) '{' 앞에 없습니다.
1>c:\program files\microsoft visual studio\myprojects\hw00\3x3matrix.cpp(8) : error C2143: 구문 오류 : ';'이(가) '}' 앞에 없습니다.
왜 이와 같은 오류가 나는지 모르겠습니다..
댓글 달기