메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

묻고 답하기
조회 수 5,277 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?
  • Question 2013.03.20 14:27 글쓴이
    에러는 총 3개 인데.. 하나씩 해결해 보겠습니다.

    Error 1 error C2144: syntax error : 'int' should be preceded by ')' c:\users\administrator\downloads\src\main.cpp 35 _23tree
    Error 2 error C2660: 'sumRaggedArray' : function does not take 0 arguments c:\users\administrator\downloads\src\main.cpp 35 _23tree
    Error 3 error C2059: syntax error : ')' c:\users\administrator\downloads\src\main.cpp 35 _23tree


    1.  35번째 줄
     sum = sumRaggedArray(int ptable,int rowarr,int row);  에서 int 를 없애야 합니다.
       sum = sumRaggedArray(int ptable,int rowarr,int row);
      
    아래처럼 되겠죠?
     sum = sumRaggedArray( pTable, rowarr, row);



    2. 35번째 줄
    sum = sumRaggedArray(int ptable,int rowarr,int row);  에서 ptable 은 존재하지 않습니다. 
    이름을 확인해야 합니다.
     pTable 로 변경하면 됩니다.


     sum = sumRaggedArray( pTable, rowarr, row);


    3. 35번째 줄
    1, 2번이 해결되니 없어 지네요.^^





    코드를 정리해보면
     
    #include <iostream>
    using namespace std;
    int sumRaggedArray(int**,int*,int);

    void main(){
    int **pTable;
    int row ,col,col2;
    int rowco,colco;
    int rowarr[10];
    int sum=0;
    cout<<"행의 값 입력: ";
    cin>>row;
    pTable = (int**)calloc(row+1,sizeof(int*));
    for(rowco=0;rowco < row ; rowco++)
    {
    cout<<"열의 값입력 : ";
    cin>>col;
    pTable[rowco] = (int *)calloc(col+1, sizeof(int));
    rowarr[rowco]=col;
    cout<<"열저장인수 "<<rowarr[rowco]<<endl;
    for(colco=0;colco < col;colco++){
    cin >> col2;
    pTable[rowco][colco]=col2;
    cout<<"pTable["<<rowco<< "] 값"<<*pTable[rowco]<<endl;
    }
    }
    for(rowco=0;rowco < row ; rowco++)
    {
    for(colco=0;colco < rowarr[rowco];colco++){
    cout<<*pTable[rowco]<<" ";
    pTable[rowco]++;
    }
    cout<<endl;
    }
    sum = sumRaggedArray( pTable, rowarr, row);
    cout << "배열의 합" << sum<< endl;
    free(pTable);
    }
    int sumRaggedArray(int** pptable,int *rowarr1,int row1){
    int sum=0;
    int i,j;
    for(i=0;i<row1 ;i++)
    {
    for(j=0;j<rowarr1[i];j++)
    {
    //cout<<*ppTable[i]<<" ";
    sum += *pptable[i];
    pptable[i]++;

    }
    cout<<endl;
    }
    return sum;
    }

  1. c# 테트리스 질문입니다.

    Date2013.06.17 Category :프로그래밍 Reply1
    Read More
  2. 더블버퍼링...

    Date2013.06.02 Category :프로그래밍 Reply1
    Read More
  3. C언어 문제가 너무 어려워서 질문드려요

    Date2013.05.24 Category :프로그래밍 Reply1
    Read More
  4. 선생님, 테트리스 관련해서 질문이 있습니다..^^;

    Date2013.05.19 Category :프로그래밍 Reply3
    Read More
  5. C언어 문제좀 풀어주세요~

    Date2013.05.10 Category :프로그래밍 Reply1
    Read More
  6. c언어 초보좀 도와주세요

    Date2013.04.20 Category :프로그래밍 Reply1
    Read More
  7. asd

    Date2013.04.13 Category :프로그래밍
    Read More
  8. c++ 코드좀 봐주세요

    Date2013.03.20 Category :프로그래밍 Reply1
    Read More
  9. 궁금한게 있습니다.

    Date2013.01.19 Category :프로그래밍 Reply1
    Read More
  10. ponyprog 질문좀 드릴게요.

    Date2012.12.09 Category :프로그래밍 Reply3
    Read More
  11. zigbex c# 질문입니다.

    Date2012.11.25 Category :프로그래밍 Reply1
    Read More
  12. 주차장

    Date2012.11.06 Category :프로그래밍 Reply3
    Read More
  13. 선생님 보드 선언에서 의문점과 작동법좀 가르쳐주세요.

    Date2011.11.09 Category :프로그래밍 Reply1
    Read More
  14. 비밀글 입니다.

    Date2011.10.24 Category :프로그래밍 Reply1
    Read More
  15. 비쥬얼 스튜디오 애러 좀 도와주세요

    Date2011.10.18 Category :프로그래밍 Reply1
    Read More
목록
Board Pagination Prev 1 2 3 4 5 Next
/ 5