这是本人的代码:
#include<iostream> void matrix_multiply(int *m1,int *m2,int *r, int x, int y, int z) { int m1Temp=0,m2Temp=0; for(int i=0;i<x;i++) { for(int j=0;j<z;j++) { for(int k=0;k<y;k++) { m1Temp = *(m1+i*y+k); m2Temp = *(m2+k*z+j); *r+=m1Temp*m2Temp; } r++; } } } int main() { int x1=0,y1=0,z1=0; std::cin>>x1>>y1>>z1; int array1[50]={0},array2[50]={0},result[50]={0}; for(int i=0;i<(x1*y1);i++) { std::cin>>array1[i]; } for(int i=0;i<(y1*z1);i++) { std::cin>>array2[i]; } matrix_multiply(array1,array2,result,x1,y1,z1); for(int j=0;j<x1;j++) { for(int i=0;i<z1;i++) { std::cout<<result[j*z1+i]<<" "; } std::cout<<std::endl; } return 0; }
这是错误详情:
PC-Lint信息: 类型 编号 内容
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “i” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “E” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “Project” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “solution” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “p2025” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 129 desc :declaration expected, identifier “s1094492” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:1 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “i” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “E” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “Project” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “solution” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “p2025” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “s1094492” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 129 desc :declaration expected, identifier “source” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:2 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “i” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “E” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “Program” ignored
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “Files” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “Microsoft” ignored
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “Visual” ignored
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “Studio” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “VC” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Error 129 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 129 desc :declaration expected, identifier “include” ignored
Error 10 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:3 have :Error 10 desc :Expecting identifier or other declarator
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\P”
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\s”
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\p”
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\s”
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\s”
Warning 606 file:\solution\p2025\s1094492\source\pc_lint.lnt at line:4 have :Warning 606 desc :Non-ANSI escape sequence: “\O”
20