#에러 메시지
submission.cpp: In function ‘int main()’:
submission.cpp:29:44: error: ‘strlen’ was not declared in this scope
for (int num3 = 0; num3 < strlen(N[num1]); num3++)
^
#소스 코드
#include <iostream>
#include <string>
using namespace std;
int main()
{
int M_num, N_num;
cin >> M_num >> N_num;
char M[1000][61];
char N[10000][61];
bool test = true;
int count = 0;
cin.getline(M[0], 60, '\n');
for (int num = 0; num < M_num; num++)
{
cin.getline(M[num], 60, '\n');
}
for (int num = 0; num < N_num; num++)
{
cin.getline(N[num], 100, '\n');
}
for (int num1 = 0; num1 < N_num; num1++)
{
for (int num2 = 0; num2 < M_num; num2++)
{
##for (int num3 = 0; num3 < strlen(N[num1]); num3++)
{
if (N[num1][num3] != M[num2][num3])
{
test = false;
}
}
if (test == true)
{
count += 1;
}
test = true;
}
}
cout << count << endl;
return 0;
}
xo0523xo
#에러 메시지
submission.cpp: In function ‘int main()’:
submission.cpp:29:44: error: ‘strlen’ was not declared in this scope
for (int num3 = 0; num3 < strlen(N[num1]); num3++)
^
#소스 코드
에러라고 나오는데 visual studio에서는 이상이 없다고 하거든요
11년 전