View Single Post
Join Date: Nov 2008
Posts: 3
Reputation: vahny is an unknown quantity at this point 
Solved Threads: 0
vahny vahny is offline Offline
Newbie Poster

c++ program to find the product of two array of integers-clear errors?

 
0
  #1
Nov 21st, 2008
  1. #include<iostream.h>
  2. int main()
  3. {
  4. int row1[10];
  5. int col2[10];
  6. int m,n,p,q;
  7. cout<<"Enter the number of rows in matrix A"<<endl;
  8. cin>>m;
  9. cout<<"Enter the number of columns in matrix A"<<endl;
  10. cin>>n;
  11. cout<<"Enter the number of rows in matrix B"<<endl;
  12. cin>>p;
  13. cout<<"Enter the number of columns in matrix B"<<endl;
  14. cin>>q;
  15. if(n!=p)
  16. {
  17. int i=0;
  18. cout<<"enter the rows of matrix1"<<endl;
  19. for(i=0;i<=m;i++)
  20. {
  21. cin>>row1[i];
  22. int *ptrow= &row1[0];
  23. row1[i]= *(row1+i);
  24. }
  25. cout<<"enter the cols of matrix1"<<endl;
  26. int k=0;
  27. for(k=0;k<=;k++;)
  28. {
  29. cin>>row1[k];
  30. int *ptcol2= &col2[0];
  31. col2[k]= *(col2+k);
  32. }
  33. int matpro (int row1, int col2, int (*matpro)(int,int));
  34. {
  35. int pro[i][k];
  36. for(i=0;i<m;i++;)
  37. {
  38. for(k=0;k<=q;q++)
  39. {
  40. pro[i][k]= row1[i] * col2[k];
  41. int *ptpro= &pro[0];
  42. pro[i][k] = *(pro+i);
  43. pro++;
  44. }
  45. }
  46. cout << "[" << i << "][" << j << "]: " << pro[i][j];
  47. return(pro[i][k]);
  48. }
  49. }
  50. }

it is showing errors like

  1. expected primary-expression before ‘;’ token
  2. 27: error: expected `)' before ‘;’ token
  3. 27: error: expected primary-expression before ‘)’ token
  4. :27: error: expected `;' before ‘)’ token
  5. :36: error: expected `)' before ‘;’ token
  6. :36: error: expected primary-expression before ‘)’ token
  7. :36: error: expected `;' before ‘)’ token
  8. :48: error: expected `}' at end of input
  9. :48: error: expected `}' at end of input
  10. 48: error: expected `}' at end of input
  11.  
Last edited by jbennet; Nov 21st, 2008 at 10:56 am.
Reply With Quote