가능한 중복 :
Must declare function prototype in C?C에서 함수를 선언해야합니까?
내가 C를 배우고 그리고 책에 내가 코드의이 재미있는 이야기를 읽고 있어요는 void scalarMultiply(int nRows, int nCols, int matrix[nRows][nCols], int scalar);
의 문이있다. 이 줄을 포함하지 않아도 프로그램이 작동하는 것 같습니다.
int main(void)
{
void scalarMultiply(int nRows, int nCols, int matrix[nRows][nCols], int scalar);
void displayMatrix(int nRows, int nCols, int matrix[nRows][nCols]);
int sampleMatrix[3][5] = {
{ 7, 16, 55, 13, 12},
{ 12, 10, 52, 0, 7 },
{ -2, 1, 2, 4, 9 }
};
scalarMultiply(3, 5, sampleMatrix, 2);
} void scalarMultiply(int nRows, int nCols, int matrix[nRows][nCols], int scalar){
int row, column;
for (row = 0; row < nRows; ++row)
for (column = 0; column < nCols; ++column)
matrix[row][column] *= scalar;
}
잘 알고 있습니다. 감사. – steve
[C에서 함수 프로토 타입을 선언해야 함] (http://stackoverflow.com/questions/2575153/must-declare-function-prototype-in-c) [나는 특히 AndreyT의 대답을 추천합니다] –
제목은 C, 질문이라고 말합니다. C는 태그에 C++이 있다고 말합니다. 왜? – GManNickG