2D array problem

/*I'm trying to get increment of salary to the second colum but it gives this error when i compile

/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-1.7.28-2/winsup/cygwin/lib/libcmain.c:39: undefined reference to `WinMain'
/usr/src/debug/cygwin-1.7.28-2/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status

How can i fix this error.?thanks..
*/



#include<iostream>
using namespace std;
void inputdata(double salary[][3],int row);
void calincrement(double salary[][3],int row);

int main()
{
double tbl[10][3];

inputdata(tbl,9) ;
calincrement(tbl,9);


return 0;
}

void inputdata(double salary[][3],int row)
{
for(int a=0;a<=row;a++)
{
cout<<"Enter salary "<<a<<endl;
cin>>salary[a][0];
}
}



void calincrement(double salary[][3],int row)
{ int x ;
for(int a=0;a<=row;a++)
{
salary[a][1]=salary[a][0]*0.01 ;
cout<<salary[a][1]<<endl;

}

}
Last edited on
Sounds like you created a windows application instead of a console application.
Topic archived. No new replies allowed.