curiousEngine wrote:
> Is the problem with the 2 functions?? G++ gives such type of error.
>
> #include <iostream>
> using namespace std;
>
> int i, j;
> int myarr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9}, arr1[10] = {11, 12, 13,
> 14, 15, 16, 17, 18, 19, 20};
>
> void dispMyarr(int l){
> if ((myarr[l] % 3) ==0)
> cout<<myarr[l];
> else
> cout<<"-";
> }
>
> void dispArr1(int l){
> if((arr1[l] % 3) == 0)
> cout<<arr1[l];
> else
> cout<<"-";
> }
> int main(int argc, char** argv)
> {
> for(int k = 0 ; k < 10; k++){
> cout<<k<<dispMyarr(k)<<dispArr1(k)<<endl;
You're trying to output the result of calling two void functions.
Think about it.
> }
>
>
> return 0;
> }
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


|