Advertisement

05.26.2007 at 12:31AM PDT, ID: 22596112
[x]
Attachment Details

Pointer question: return makes pointer from integer without a cast

Asked by Jasbir21 in C Programming Language

Tags: integer, without, pointer, from, makes

Hi,
I did a small code so that return type is of pointer..but I am getting error: return makes pointer from integer without a cast .

int *add(int *,int*);

int main()
{
 int *a=10, *b=50;
 int *c;

*c=add(&a,&b);
printf("The value is %d\n",*c);

return 1;

}

int *add(int *a,int *b)
{
return (*a + *b);

}Start Free Trial
[+][-]05.26.2007 at 01:53AM PDT, ID: 19161422

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Tags: integer, without, pointer, from, makes
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.26.2007 at 02:04AM PDT, ID: 19161442

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.26.2007 at 03:10AM PDT, ID: 19161546

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.26.2007 at 03:47AM PDT, ID: 19161585

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.26.2007 at 04:14AM PDT, ID: 19161631

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.26.2007 at 04:16AM PDT, ID: 19161634

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32