for(i = 0; i < numrecs ; i++)
cout<<setw(20)<<employee[i].id//display struct data id
<<setw(15)<<employee[i].id//display struct data id
<<setw(6)<<employee[i].rate//display struct data rate
<<endl;
--------------------Configuration: Soalan3 - Win32 Debug--------------------
Compiling...
Soalan3.cpp
f:\c++lab2\soalan3.cpp(89) : error C2440: 'initializing' : cannot convert from 'struct PayRecord' to 'int'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
f:\c++lab2\soalan3.cpp(90) : error C2108: subscript is not of integral type
f:\c++lab2\soalan3.cpp(90) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct PayRecord []' (or there is no acceptable conversion)
f:\c++lab2\soalan3.cpp(91) : error C2108: subscript is not of integral type
f:\c++lab2\soalan3.cpp(91) : error C2440: '=' : cannot convert from 'int' to 'struct PayRecord []'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
line 88. the variable type is int. you are trying to store an instance of "Struct Payrecord" as an int. temp should be declared as type struct Payrecord.
thank you....!i have try your recommendation...the error does reduce but still leaving a problem
--------------------Configuration: Soalan3 - Win32 Debug--------------------
Compiling...
hehe.cpp
F:\c++lab2\hehe.cpp(89) : error C2108: subscript is not of integral type
F:\c++lab2\hehe.cpp(89) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'struct PayRecord []' (or there is no acceptable conversion)
F:\c++lab2\hehe.cpp(90) : error C2108: subscript is not of integral type
F:\c++lab2\hehe.cpp(90) : error C2440: '=' : cannot convert from 'struct PayRecord' to 'struct PayRecord []'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
hehe.obj - 4 error(s), 0 warning(s)
-------------------------------------------------
especially at the line 90...we don't need to declare the same variable twice right..so i'm leaving the temp as it was...( i have try to declare the temp and it doesn't work...)
and yup...the above line keep confusing me too....@o@
The prototype on line 19 and the implementation on line 59 don't match. If you want an array of an unkonw size you should write it like so: void selectionSort(PayRecord employee[], int numrecs2); // Note the []