Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: waht does "Invalid Address specified to RtlValidateHeap" mean? Pin
greenwyx12-Oct-05 15:27
greenwyx12-Oct-05 15:27 
GeneralRe: waht does "Invalid Address specified to RtlValidateHeap" mean? Pin
Chris Losinger12-Oct-05 15:43
professionalChris Losinger12-Oct-05 15:43 
GeneralRe: waht does "Invalid Address specified to RtlValidateHeap" mean? Pin
greenwyx12-Oct-05 15:51
greenwyx12-Oct-05 15:51 
GeneralRe: waht does "Invalid Address specified to RtlValidateHeap" mean? Pin
Prakash Nadar13-Oct-05 6:04
Prakash Nadar13-Oct-05 6:04 
GeneralRe: waht does "Invalid Address specified to RtlValidateHeap" mean? Pin
greenwyx13-Oct-05 14:36
greenwyx13-Oct-05 14:36 
QuestionProcessor Information 32-bit app on 64-bit Machine Pin
sergioh7812-Oct-05 14:32
sergioh7812-Oct-05 14:32 
QuestionSubclassing MFC controls for ActiveX Pin
gaarons12-Oct-05 13:03
gaarons12-Oct-05 13:03 
QuestionNeed Help With Calculation Pin
WackoWolf12-Oct-05 12:40
WackoWolf12-Oct-05 12:40 
The program works, but the calculation is wrong. The is written in C. Could someone tell me what I am doing wrong?

Thank You

#include "stdafx.h"
#include <math.h>

#using <mscorlib.dll>

using namespace System;

// Function prorotypes

void sphere_volume (double);

// PI is a constant

const double PI=3.14159;


int _tmain()


{
// Integer local to Main to store initial radius value
double r;

printf("Please Enter A Positive Radius Value\n");
scanf("%lf", &r);

// If Else Function To Make Sure The User Types A Positive and Not A Negative Integer.

if (r >= 0)
sphere_volume (r);

else
printf("You Must Enter A Positive Integer!!!! Not A Negative Integer!!!\n");

return 0;

}

// This Is The Fnction That Does The Calculations For The Volume.

void sphere_volume (double radius)

{
double radius_cubed;

double exponent=3;

double volume;

printf("This Is The Test To See If R Was Passed To The Function: %lf\n", radius);

radius_cubed=pow(radius, exponent);

volume=(4/3)*PI*radius_cubed;

printf("The Volume Of The Sphere is %lf\n", volume);
}


Joseph L. Gelsomino
AnswerRe: Need Help With Calculation Pin
Roger Allen12-Oct-05 13:38
Roger Allen12-Oct-05 13:38 
AnswerRe: Need Help With Calculation Pin
David Crow13-Oct-05 3:19
David Crow13-Oct-05 3:19 
QuestionAccelerator key issue in hosted ActiveX control Pin
Ian Bowler12-Oct-05 12:35
Ian Bowler12-Oct-05 12:35 
QuestionCResourceException Pin
LighthouseJ12-Oct-05 12:08
LighthouseJ12-Oct-05 12:08 
QuestionMultiLingual Resource Pin
jim45612-Oct-05 11:54
jim45612-Oct-05 11:54 
Questionmalloc and free problem. Pin
Jader8912-Oct-05 11:47
Jader8912-Oct-05 11:47 
AnswerRe: malloc and free problem. Pin
Jader8912-Oct-05 11:51
Jader8912-Oct-05 11:51 
AnswerRe: malloc and free problem. Pin
Anonymous12-Oct-05 12:02
Anonymous12-Oct-05 12:02 
GeneralRe: malloc and free problem. Pin
Jader8912-Oct-05 12:08
Jader8912-Oct-05 12:08 
GeneralRe: malloc and free problem. Pin
LighthouseJ12-Oct-05 12:10
LighthouseJ12-Oct-05 12:10 
AnswerRe: malloc and free problem. Pin
sunit512-Oct-05 20:43
sunit512-Oct-05 20:43 
QuestionVisual C++ .Net Dialog Help Wizard Pin
Cubzfan12-Oct-05 11:14
Cubzfan12-Oct-05 11:14 
QuestionEnumProcesses question Pin
Gary Wheeler12-Oct-05 10:43
Gary Wheeler12-Oct-05 10:43 
AnswerRe: EnumProcesses question Pin
Prakash Nadar12-Oct-05 22:45
Prakash Nadar12-Oct-05 22:45 
GeneralRe: EnumProcesses question Pin
Gary Wheeler13-Oct-05 2:18
Gary Wheeler13-Oct-05 2:18 
AnswerRe: EnumProcesses question Pin
ThatsAlok13-Oct-05 1:38
ThatsAlok13-Oct-05 1:38 
GeneralRe: EnumProcesses question Pin
Gary Wheeler13-Oct-05 2:20
Gary Wheeler13-Oct-05 2:20 

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.