c++ programming.

조회 수: 5 (최근 30일)
abeer hafeez
abeer hafeez 2021년 10월 27일
편집: Bruno Luong 2021년 10월 27일
i have a question , for grade 10 students , in programming c++ . void main(void) , why the syntax is wrong?.
if anyone know please let me know,
i am going to paste the programming which i have done.
i done all the syntax correct but it`s coming wrong,
this one is my program.this one is my program.
this is from book. i don't see any difference.

답변 (2개)

Bruno Luong
Bruno Luong 2021년 10월 27일
편집: Bruno Luong 2021년 10월 27일
In C++ the main function signature should be
int main()
The void argument is for C (not C++).
Your code has illegal comma "," in the line #4
and missing semin-colon ";" at the end of the lines #5 & 8.

Rik
Rik 2021년 10월 27일
You forgot two things:
  1. This is a Matlab forum and nothing in your question is related to Matlab
  2. Every line should end with a semicolon, and you have forgotten two of them, as the error messages point out.
  댓글 수: 2
abeer hafeez
abeer hafeez 2021년 10월 27일
so i can`t ask any question related to computer or maths , sorry.
Rik
Rik 2021년 10월 27일
There are other websites devoted to that. Just like you don't go buy fruit in a clothing store.
But if this answer solved your issue, please consider marking it as accepted answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by