2D array calculation

/*when I compile this it gives a error message..
/tmp/ccxagark.o:os.cpp:(.text+0x2e): undefined reference to `calincrement(double (*) [3], int)'
/tmp/ccxagark.o:os.cpp:(.text+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `calincrement(double (*) [3], int)'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccxagark.o: bad reloc address 0xc in section `.xdata'
collect2: error: ld returned 1 exit status

What the error in my code?thanks
*/







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

int man()
{
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(int 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;

}

}
Your declaration and implementation do not agree.
1
2
void calincrement(double salary[][3],int row);
void calincrement(int salary[][3],int row)


PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/

Topic archived. No new replies allowed.