Hi, ive been trying to get this code to work, but the calculations just doesnt work. it gives me something like 1de00067 something like that. I seriously dont see the error :/ Any help is appreciated.

P.S. is it something about: "Initializing the lenth and the width?" i dont remember how to do that, help with that is appreciated. Thanks :)

#include <iostream>
using namespace std;

float poolsize(float length, float width, float depth); //function for volume

void main ()
{ 
	float length;
	float width;
	float depth;
	float volume;

	cout << "Insert the length: ";
	cin >> length;
	cout << "Insert the width: ";
	cin >> width;
	cout << "Insert the depth: ";
	cin >> depth;

	volume = poolsize(length, width, depth);
	cout << "The volume of the pool is: "<< poolsize;

	system("pause");
}

float poolsize(float length, float width, float depth)
{
	return length*width*depth;
}

line 21 change poolsize to volume

commented: ty +1

omg. cant believe that. i guess final weeks are getting the best out of me. thanks bro. really appreciate it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.