Results 1 to 3 of 3
I tried to run the following programme using g++ in linux mint and got a wonderful error.......
a little help please
//programme to find transpose of a matrix
#include<iostream>
int ...
- 02-01-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 2
c ++ error
I tried to run the following programme using g++ in linux mint and got a wonderful error.......
a little help please
//programme to find transpose of a matrix
#include<iostream>
int main()
{
using namespace std;
int a[10][10],b[10][10],i,j,m,n;
cout <<"Enter the number of rows and columns of the matrix -"<<endl;
cin>>m>>n;
cout<<"Input the values of the matrix ="<<endl;
for(i=0;i<m;i++)
{
for (j=0;j<n;j++)
cin>>a[i][j];
}
cout<<"the matrix enterd is :"<<endl;
for (i=0;i<m;i++)
{
cout <<"\n";
for (j=0;j<n;j++)
cout <<" "<<a[i][j];
}
cout <<"The transpose of the matrix u have enterd is -";
for (i=0;i<m;i++)
{
cout<<"\n";
for (j=0;j<n;j++)
b[i][j]=a[i][j];
cout<<b[i][j]<<" ";
}
return 0;
}
error:-


/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o: In function `_start':
/build/buildd/eglibc-2.10.1/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
- 02-01-2010 #2
Could you post your makefile or compile line...
Make mine Arch Linux
- 02-01-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
The problem is here:
The signature for main() is defined as eitherCode:int main() { . . . }
orCode:int main(void)
The second argument can be either as shown, or can be char**, or const char*[], or char*[] as well, depending upon how mutable you want your argument list and its contents to be. In any case, it has to be some sort of arrays of pointers to char strings, or a void argument list altogether.Code:int main(int, const char**)
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote