Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Program won't run.

Posted on 1998-12-13
Medium Priority
189 Views
The program is not difficult, but when I use pointers it won't run.The program is as follows:
/* This program asks for the circumference and calculates the circle's radius and its area*/
#include<iostream.h>
#include<math.h>
#define PI 3.14159
void main(void)
{
void areas(double);
cout<<"Entre la circumferencia del circulo, para computar su area\n";
cin>>circum;
cout<<"El area de el circulo de circumferencia "<<circum<<"es "<<area;
}
{
}
{
double area;
}
0
Question by:jorhez
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2

LVL 22

Expert Comment

ID: 1180082
I don't see any problems there  But you said you are having problems with pointers.  I don't see any pointers anywhere.

Can you explain the problem a little more?
0

LVL 8

Accepted Solution

ID: 1180083
It's not a pointer problem, it's that your not return values from your 2 functions correctly

C++ Language Question
Title: "Program won't run."

From: jorhez
Date: Sunday, December 13 1998 - 05:15PM PST
Points: 50 Points (Easy)

The program is not difficult, but when I use pointers it won't run.The program is as follows:
/* This program asks for the circumference and calculates the circle's radius and its area*/
#include<iostream.h>
#include<math.h>
#define PI 3.14159
void main(void)
{
double areas(double);
cout<<"Entre la circumferencia del circulo, para computar su area\n";
cin>>circum;
cout<<"El area de el circulo de circumferencia "<<circum<<"es "<<area;
}
{
}
{
double area;
return area ;
}
0

LVL 8

Expert Comment

ID: 1180084
Ooops...I meant to say

"It's not a pointer problem, it's that you're not returning values from your 2 functions correctly "

BTW if you want to use pointers instead of return values from functions, here's an example I version of your program that does that

#include<iostream.h>
#include<math.h>
#define PI 3.14159
void main(void)
{
void areas(double, double *);
cout<<"Entre la circumferencia del circulo, para computar su area\n";
cin>>circum;
cout<<"El area de el circulo de circumferencia "<<circum<<"es "<<area;
}
{
}
{
double area;
*parea = area ;
}
0

LVL 8

Expert Comment

ID: 1180085
Oops another error

1. in my 6:23PM program, change

to

2. In my 6:47PM program, change

to
void areas(double radio, double * parea)

0

LVL 22

Expert Comment

ID: 1180086
I can't believe I missed that.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
###### Suggested Courses
Course of the Month7 days, 21 hours left to enroll