Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to access BITMAP bmBits - getting void* - unknown size error . Pin
Richard MacCutchan26-Jan-11 22:32
mveRichard MacCutchan26-Jan-11 22:32 
GeneralRe: How to access BITMAP bmBits - getting void* - unknown size error . Pin
garaber27-Jan-11 2:53
garaber27-Jan-11 2:53 
GeneralRe: How to access BITMAP bmBits - getting void* - unknown size error . Pin
garaber27-Jan-11 3:05
garaber27-Jan-11 3:05 
GeneralRe: How to access BITMAP bmBits - getting void* - unknown size error . Pin
Richard MacCutchan27-Jan-11 3:19
mveRichard MacCutchan27-Jan-11 3:19 
QuestionAdd iamge to subbutton in RibbonStatusbar failed? Pin
coolhem17-Sep-10 17:23
coolhem17-Sep-10 17:23 
QuestionDouble average Pin
Tim Dappen17-Sep-10 12:09
Tim Dappen17-Sep-10 12:09 
AnswerRe: Double average Pin
Maximilien17-Sep-10 12:44
Maximilien17-Sep-10 12:44 
GeneralRe: Double average Pin
Tim Dappen17-Sep-10 12:56
Tim Dappen17-Sep-10 12:56 
Since the question is just to write a function, NO, I didn't try to run a program.

I Think the answer to this is:

Double average (int size, double values []);
{return (a);} {return (a + b) / 2;} {return (a + b + c) /3;} {return (a + b + c + d / 4;}
{return (a + b + c + d + e / 5;}


I really don't have a clue what I'm doing so I'm winging it to say the least. I'm thinking the above is in the ball park because in my text book, there's a program called Average.c that goes like this:

#include <stdio.h>

double average (double a, double b);

int main(void)
{
double x, y, z;

printf("Enter three numbers: ");
scanf("%1f%1f%1f", &x, &y, &z);

printf("average of %g and %g: %g\n", x, y, average (x, y));
printf("average of %g and %g: %g\n", x, y, average (y, z));
printf("average of %g and %g: %g\n", x, y, average (x, z));

return 0;
}

double average (double a, double b)
{
return (a + b) / 2;

while(1);

}

Am I in the ball-park for the function part???

Oh ya, I have no idea what Maximilien was talking about with all the
"simple loop, a couple of std::cin and std::cout , an accumulator, a counter, * and / ..." Sounds like what adults sound like on Peanuts cartoons.
GeneralRe: Double average Pin
Richard MacCutchan17-Sep-10 22:07
mveRichard MacCutchan17-Sep-10 22:07 
QuestionRe: Double average Pin
David Crow17-Sep-10 15:58
David Crow17-Sep-10 15:58 
AnswerRe: Double average Pin
Maximilien17-Sep-10 16:59
Maximilien17-Sep-10 16:59 
GeneralRe: Double average Pin
David Crow18-Sep-10 9:33
David Crow18-Sep-10 9:33 
AnswerRe: Double average Pin
Tim Craig18-Sep-10 7:08
Tim Craig18-Sep-10 7:08 
AnswerRe: Double average Pin
Stephen Hewitt17-Sep-10 19:19
Stephen Hewitt17-Sep-10 19:19 
AnswerRe: Double average Pin
Aescleal18-Sep-10 8:26
Aescleal18-Sep-10 8:26 
GeneralRe: Double average Pin
Stephen Hewitt18-Sep-10 20:57
Stephen Hewitt18-Sep-10 20:57 
GeneralRe: Double average [modified] Pin
Stefan_Lang28-Sep-10 2:28
Stefan_Lang28-Sep-10 2:28 
QuestionUsing Windows DataGridViewTool Pin
Danzy8317-Sep-10 4:42
Danzy8317-Sep-10 4:42 
AnswerRe: Using Windows DataGridViewTool [modified] Pin
Cool_Dev17-Sep-10 5:15
Cool_Dev17-Sep-10 5:15 
GeneralRe: Using Windows DataGridViewTool Pin
Danzy8317-Sep-10 5:34
Danzy8317-Sep-10 5:34 
GeneralRe: Using Windows DataGridViewTool Pin
Cool_Dev17-Sep-10 5:38
Cool_Dev17-Sep-10 5:38 
AnswerRe: Using Windows DataGridViewTool Pin
Rolf Kristensen20-Sep-10 10:10
Rolf Kristensen20-Sep-10 10:10 
QuestionNew into parallel programming, looking for advice Pin
Stefan_Lang17-Sep-10 4:20
Stefan_Lang17-Sep-10 4:20 
AnswerRe: New into parallel programming, looking for advice [modified] Pin
Paul Michalik17-Sep-10 22:35
Paul Michalik17-Sep-10 22:35 
GeneralRe: New into parallel programming, looking for advice Pin
Stefan_Lang19-Sep-10 22:37
Stefan_Lang19-Sep-10 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.