edited
1,142 views
0 votes
0 votes

I am unable to understand the error code. What does 'invalid conversion from int to int mean ? plz help.

The code-

#include <stdio.h>

int function(int *);

int main()
{
    int i=35,*z;
    
    z=function (&i);
    
    printf("%d\n",z);
    
    return 0;
    
}

int function(int *m)
{
    return(*m+2);

}

the question is to find the error in the code.

edited

1 Answer

2 votes
2 votes
#include <stdio.h>

int function(int *);

int main()
{
    int i=35,z;
     
    z=function (&i);
     
    printf("%d\n",z);
     
    return 0;
     
}

int function(int *m)
{
    return(*m+2);

}

 

 

 

Return type of function is integer

Related questions

3 votes
3 votes
1 answer
1
Rudra Pratap asked Jun 25, 2017
1,314 views
#include<stdio.h int main() { int i = 0x1 << sizeof(int)*8-1; printf("\n%x",i); i = i > sizeof(int)*8-1; printf("%d",i); }Find the output ?
0 votes
0 votes
1 answer
2
Rudra Pratap asked Jun 25, 2017
502 views
#include<stdio.h>int main(){ int x=20; printf("%d %d ",x ,++x);}unable to understand how it prints the output. plz help
0 votes
0 votes
1 answer
3
ranarajesh495 asked Oct 9, 2018
594 views
If we are taking character as input then how we can check the character against a a range of numbers. Please explain
1 votes
1 votes
0 answers
4
KashishNarang asked Aug 23, 2018
268 views
Output will be-int main(){ int a =0,b=1,c=3:*((a)?&b&:&a)=a ? b : c;printf("%d %d%d ", a,b,c);}