죄송합니다. 글 내리겠습니다.

nietzzche의 이미지

죄송합니다. 글 내리겠습니다.

moonend의 이미지

에러 관련 질문을 할 때는 어떤 환경에서 실행시켰는지, 어떤 에러가 나는지 이야기해주셔야 합니다.
6하 원칙을 지켜야 편하다는 것은 어디나 마찬가지입니다.

nietzzche의 이미지

숙제를 부탁드리려고 한 것보다, 조언을 부탁드린 거였습니다.(목적이 무엇이든, 정말 죄송합니다.^^)

비쥬얼 스튜디오 C++ 에서 실행을 시켰으며, 디버깅 과정에서 오류가 64개가 떴습니다. 간단한 프로그래밍 같은 경우에는

더블클릭후에 오류를 찾을 수가 있었는데, 제가 아직 못배운 과정을 하려다보니, 오류를 찾아도 왜 오류가 떴는지를 몰라서 질문을 올렸습니다.

오류가 많이 뜨는데, 어디서부터 설명을 드려야 할지 모르겠습니다. 우선, 오류 코드입니다.(다음부터는 6하 원칙에 맞춰서 올리겠습니다. 죄송합니다.)

c:\users\hek\desktop\프로그래밍\하자2.c(1) : error C2006: #include expected a filename, found 'newline'
c:\users\hek\desktop\프로그래밍\하자2.c(2) : error C2006: #include expected a filename, found 'newline'
c:\users\hek\desktop\프로그래밍\하자2.c(5) : error C2061: syntax error : identifier 'std'
c:\users\hek\desktop\프로그래밍\하자2.c(5) : error C2059: syntax error : ';'
c:\users\hek\desktop\프로그래밍\하자2.c(5) : error C2059: syntax error : ':'
c:\users\hek\desktop\프로그래밍\하자2.c(6) : error C2061: syntax error : identifier 'std'
c:\users\hek\desktop\프로그래밍\하자2.c(6) : error C2059: syntax error : ';'
c:\users\hek\desktop\프로그래밍\하자2.c(6) : error C2059: syntax error : ':'
c:\users\hek\desktop\프로그래밍\하자2.c(7) : error C2061: syntax error : identifier 'std'
c:\users\hek\desktop\프로그래밍\하자2.c(7) : error C2059: syntax error : ';'
c:\users\hek\desktop\프로그래밍\하자2.c(7) : error C2059: syntax error : ':'
c:\users\hek\desktop\프로그래밍\하자2.c(9) : error C2061: syntax error : identifier 'Figure'
c:\users\hek\desktop\프로그래밍\하자2.c(9) : error C2059: syntax error : ';'
c:\users\hek\desktop\프로그래밍\하자2.c(10) : error C2449: found '{' at file scope (missing function header?)
c:\users\hek\desktop\프로그래밍\하자2.c(23) : error C2059: syntax error : '}'
c:\users\hek\desktop\프로그래밍\하자2.c(45) : error C2059: syntax error : '}'
c:\users\hek\desktop\프로그래밍\하자2.c(50) : error C2065: 'Figure' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(50) : error C2065: 'fg' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(50) : error C2065: 'NULL' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(50) : error C2106: '=' : left operand must be l-value
c:\users\hek\desktop\프로그래밍\하자2.c(53) : error C2065: 'cin' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(53) : error C2224: left of '.clear' must have struct/union type
c:\users\hek\desktop\프로그래밍\하자2.c(54) : warning C4013: 'fflush' undefined; assuming extern returning int
c:\users\hek\desktop\프로그래밍\하자2.c(54) : error C2065: 'stdin' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(55) : warning C4013: 'system' undefined; assuming extern returning int
c:\users\hek\desktop\프로그래밍\하자2.c(56) : error C2065: 'cout' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(56) : error C2297: '<<' : illegal, right operand has type 'char [30]'
c:\users\hek\desktop\프로그래밍\하자2.c(57) : error C2297: '<<' : illegal, right operand has type 'char [51]'
c:\users\hek\desktop\프로그래밍\하자2.c(58) : error C2297: '<<' : illegal, right operand has type 'char [16]'
c:\users\hek\desktop\프로그래밍\하자2.c(59) : error C2143: syntax error : missing ';' before 'type'
c:\users\hek\desktop\프로그래밍\하자2.c(60) : error C2065: 'choice' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(60) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
c:\users\hek\desktop\프로그래밍\하자2.c(61) : error C2224: left of '.fail' must have struct/union type
c:\users\hek\desktop\프로그래밍\하자2.c(63) : error C2297: '<<' : illegal, right operand has type 'char [33]'
c:\users\hek\desktop\프로그래밍\하자2.c(64) : warning C4013: 'getch' undefined; assuming extern returning int
c:\users\hek\desktop\프로그래밍\하자2.c(70) : error C2065: 'new' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(70) : error C2146: syntax error : missing ';' before identifier 'Triangle'
c:\users\hek\desktop\프로그래밍\하자2.c(70) : error C2065: 'Triangle' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(72) : error C2146: syntax error : missing ';' before identifier 'Pyramid'
c:\users\hek\desktop\프로그래밍\하자2.c(72) : error C2065: 'Pyramid' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(74) : error C2146: syntax error : missing ';' before identifier 'Diamond'
c:\users\hek\desktop\프로그래밍\하자2.c(74) : error C2065: 'Diamond' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(76) : error C2297: '<<' : illegal, right operand has type 'char [35]'
c:\users\hek\desktop\프로그래밍\하자2.c(77) : warning C4013: 'exit' undefined; assuming extern returning int
c:\users\hek\desktop\프로그래밍\하자2.c(79) : error C2297: '<<' : illegal, right operand has type 'char [24]'
c:\users\hek\desktop\프로그래밍\하자2.c(80) : error C2143: syntax error : missing ';' before 'type'
c:\users\hek\desktop\프로그래밍\하자2.c(81) : error C2065: 'height' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(81) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
c:\users\hek\desktop\프로그래밍\하자2.c(82) : error C2224: left of '.fail' must have struct/union type
c:\users\hek\desktop\프로그래밍\하자2.c(84) : error C2297: '<<' : illegal, right operand has type 'char [35]'
c:\users\hek\desktop\프로그래밍\하자2.c(88) : error C2297: '<<' : illegal, right operand has type 'char [13]'
c:\users\hek\desktop\프로그래밍\하자2.c(89) : error C2143: syntax error : missing ';' before 'type'
c:\users\hek\desktop\프로그래밍\하자2.c(90) : error C2065: 'len' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(90) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
c:\users\hek\desktop\프로그래밍\하자2.c(91) : error C2065: 'endl' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(91) : warning C4552: '<<' : operator has no effect; expected operator with side-effect
c:\users\hek\desktop\프로그래밍\하자2.c(92) : error C2223: left of '->SetFigure' must point to struct/union
c:\users\hek\desktop\프로그래밍\하자2.c(93) : error C2223: left of '->Output' must point to struct/union
c:\users\hek\desktop\프로그래밍\하자2.c(94) : error C2065: 'delete' : undeclared identifier
c:\users\hek\desktop\프로그래밍\하자2.c(94) : error C2146: syntax error : missing ';' before identifier 'fg'
Error executing cl.exe.

하자2.obj - 52 error(s), 8 warning(s)

neocoin의 이미지

이미 neitzzche 눈앞에 친절히 답이 적혀 있습니다.
이걸 해석하면, 숙제는 의미없어집니다.

반대로 이걸 해석 못하면 다른 분야나 다른 쪽에서 재능을 찾으시거나 먼저 영어 공부를 하시는 편을 추천합니다.

lovewar의 이미지

비쥬얼 스튜디오를 사용해본적이 없어서 이것이 답이 될수 있을지 모르겠습니다.

제가 보는 관점은 파일 확장자(.c)로 인해서 비쥬얼 스튜디오가 C로 컴파일하면서 발생하는 문제로 보입니다.

관련해서 비쥬얼 스튜디오 환경을 설정하던지 아니면 파일 확장자를(.cpp)로 변경해 보세요.

나머지 오류들은 쉽게 찾을수 있을 것으로 생각합니다.

hiseob의 이미지

혹시나 < > 문제로 안보이는줄 알았는데 ㅎㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷ
아예 내용이 없네요.

viper9의 이미지

정말 의아한게... 위 코드가 본인이 직접 짠 코드가 맞는지요....?

본인이 저정도로 짤 수 있다면 이정도 오류메시지는 자연스럽게 이해하실 수 있을텐데요..

본인이 직접 짠 것인데도 잘 모르시겠다면... 정말 신기하기도 하고... C 책부터 다시 보셔야하는게 아닌가 싶습니다. 무시하는게 아니라 진심으로요..

viper9의 이미지

앗... 죄송합니다. 앞에 글을 읽었더니 과제물이었네요. 이 글을 먼저 읽다보니...;;

그렇다면 구글 검색과 구글 번역기로 오류 메시지를 읽어보며 해결하는게 공부에 도움이 되지 않을까 싶네요. 물론 C 책도 하나 있는게 좋을듯.

좋은 성적 받으시길 바랍니다. :-)

Prentice의 이미지

시작은 hello world 부터!

그리고 잘 안되시면 프로그래밍 문답 게시판을 써주세요~

darkmyth의 이미지

파일이름 부터 바꿔보아요~