Error: Void value not ignored as it ought to be 
Author Message
 Error: Void value not ignored as it ought to be

would appreciate getting some help on this.

Error: Void value not ignored as it ought to be

The function written below is not complete but the error is on the line

stdarray[w]=array[w];

Function:

void stddev(int counter, double array[], double stdarray[])
{
 int w;

 for(w=0;w<counter;w++)
 {
  double m=mean(counter, array);
  stdarray[w]=array[w];
  printf("std %f", stdarray[w]);
 }

Quote:
}



Fri, 02 Dec 2005 21:13:26 GMT  
 Error: Void value not ignored as it ought to be

Quote:

> would appreciate getting some help on this.

> Error: Void value not ignored as it ought to be

> The function written below is not complete
> but the error is on the line

> stdarray[w]=array[w];

I doubt it. I have no trouble compiling accident.c:

/* BEGIN accident.c */

#include <stdio.h>

double mean(int, double*);

void stddev(int counter, double array[], double stdarray[])
{
 int w;

 for(w=0;w<counter;w++)
 {
  double m =mean(counter, array);
  stdarray[w]=array[w];
  printf("std %f", stdarray[w]);
 }

Quote:
}

/* END accident.c */

Quote:
> Function:

> void stddev(int counter, double array[], double stdarray[])
> {
>  int w;

>  for(w=0;w<counter;w++)
>  {
>   double m=mean(counter, array);
>   stdarray[w]=array[w];
>   printf("std %f", stdarray[w]);
>  }
> }

--
pete


Fri, 02 Dec 2005 20:51:46 GMT  
 Error: Void value not ignored as it ought to be

Quote:

> would appreciate getting some help on this.

> Error: Void value not ignored as it ought to be

> The function written below is not complete but the error is on the
> line

> stdarray[w]=array[w];

> Function:

> void stddev(int counter, double array[], double stdarray[])
> {
>  int w;

>  for(w=0;w<counter;w++)
>  {
>   double m=mean(counter, array);
>   stdarray[w]=array[w];
>   printf("std %f", stdarray[w]);
>  }
> }

I think you haven't posted the most important part.
A void return value should always be ignored. I think you have something
like
 int whoops = stddev ()
somewhere.
post some calls to the function.

--
Nothing so needs reforming as other people's habits.
                -- Mark Twain



Fri, 02 Dec 2005 20:53:30 GMT  
 Error: Void value not ignored as it ought to be

Quote:

> would appreciate getting some help on this.

> Error: Void value not ignored as it ought to be

> The function written below is not complete but the error is on the line

> stdarray[w]=array[w];

I very much doubt that the error is in that line.

Quote:

> Function:

> void stddev(int counter, double array[], double stdarray[])
> {
> int w;

> for(w=0;w<counter;w++)
> {
>  double m=mean(counter, array);

Can you sho us the declaration fo "mean"?

Quote:
>  stdarray[w]=array[w];
>  printf("std %f", stdarray[w]);
> }
> }

How is stddev called?

--

"LISP  is worth learning for  the profound enlightenment  experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days."   -- Eric S. Raymond



Fri, 02 Dec 2005 21:20:41 GMT  
 Error: Void value not ignored as it ought to be

Quote:

> would appreciate getting some help on this.

> Error: Void value not ignored as it ought to be

> The function written below is not complete but the error is on the line

> stdarray[w]=array[w];

Actually, I would suspect it's on the previous line (though owing to the
fact that you haven't provided enough context, I'm guessing).

Did you, perchance, define the function "mean" as void?

In the future, to obtain best results, show the smallest possible chunk
of compilable (or what you think should be compilable) code that
exhibits the problem.

Quote:

> Function:

> void stddev(int counter, double array[], double stdarray[])
> {
>  int w;

>  for(w=0;w<counter;w++)
>  {
>   double m=mean(counter, array);
>   stdarray[w]=array[w];
>   printf("std %f", stdarray[w]);
>  }
> }

HTH,
--ag

--
Artie Gold -- Austin, Texas

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---



Fri, 02 Dec 2005 23:04:24 GMT  
 Error: Void value not ignored as it ought to be


Quote:
> would appreciate getting some help on this.
> Error: Void value not ignored as it ought to be
> The function written below is not complete but the error is on the
> line stdarray[w]=array[w];

Almost certainly the error is on the line above ...

Quote:
> Function:
> void stddev(int counter, double array[], double stdarray[])
> {
>  int w;
>  for(w=0;w<counter;w++)
>  {
>   double m=mean(counter, array);

since if you have declared mean() as having a void return type, you
would get just such a diagnostic on trying to assign that "void value"
to m.

Quote:
>   stdarray[w]=array[w];
>   printf("std %f", stdarray[w]);
>  }
> }

--
Martin Ambuhl
now exiled to
Hurricane Bait, Texas


Sat, 03 Dec 2005 01:02:16 GMT  
 Error: Void value not ignored as it ought to be
Thanks for all the help!..it was the declaration of mean function as
void..which shud have had been corrected to double as u guys said..thanks!


Sat, 03 Dec 2005 07:30:03 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Void value not ignored as it ought to be

2. Void value not ignored as it ought to

3. Int86: Error in C ANSI: (DOS.H : Value of type void is not allowed)

4. warning MIDL2368 : error generating type library, ignored : Could not set UUID : tagCONFIG_DATA

5. Is void main(void) a standard or not?

6. from void (void*) to void (_cdecl*) (void*)

7. Why am I being ignored ???

8. void mail Please ignore this

9. Returning error values vs. not returning

10. value of ESP not properly saved ERROR using connection points

11. what's the difference between void main(void) and int main(void)

12. difference between void foo(void) and void foo()

 

 
Powered by phpBB® Forum Software