Not Yet Answered # explian a function in c++ (I'm a beginner)

firstPerson 761 LevyDee 2 jonsca 1,059 Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

0

Basically, it is a block of code identifies with a name.

Not completely.

Every functions has a domain and a co-domain and its definition.

The domain is the valid range of numbers that can be accepted.

The co-domain is the valid range of numbers that the function can map to.

The definition of a function gives some explicit way to convert the input into an output.

For example, consider the function F: R - >R, where F(x) = x*x.

The function domain is R( all real numbers), the function co-domain

is R(all-real numbers) and its definition is F(x) = x*x.

Now in code its very similar :

`int F(x){ return x*x; };`

Now the domain is implicitly stated as all real numbers. So we do not check if x is an imaginary numbers( that and we can't anyways).

The co-domain is all real number and is implicitly stated by the return type of the function, int. The definition is x*x, which is in the

body of the function.

So that is a function.

It has a domain, the valid range of numbers the function can accept.

It has a co-domain, the valid ranges of numbers the function can map to or "spit out".

It has its rule, or its definition.

0

Not completely.

Every functions has a domain and a co-domain and its definition.

The domain is the valid range of numbers that can be accepted.

The co-domain is the valid range of numbers that the function can map to.The definition of a function gives some explicit way to convert the input into an output.

For example, consider the function F: R - >R, where F(x) = x*x.

The function domain is R( all real numbers), the function co-domain

is R(all-real numbers) and its definition is F(x) = x*x.Now in code its very similar :

`int F(x){ return x*x; };`

Now the domain is implicitly stated as all real numbers. So we do not check if x is an imaginary numbers( that and we can't anyways).

The co-domain is all real number and is implicitly stated by the return type of the function, int. The definition is x*x, which is in the

body of the function.So that is a function.

It has a domain, the valid range of numbers the function can accept.

It has a co-domain, the valid ranges of numbers the function can map to or "spit out".

It has its rule, or its definition.

Not sure if you were purposely trying to confuse him, but in begginers terms a function is a block of code that is called from main(which is also a function) or from another function to execute some code. Functions can accept arguments like has been already stated, but if your just learning, first learn how to call a function before you get fancy with one.

0

firstPerson's definition is more like one that might be used in a formal mathematical setting. Check out the second paragraph of http://en.wikipedia.org/wiki/Functional_programming for a comparison of the two definitions. I'm sure we could argue about the semantics of what constitutes a function (like "is a void function really a function by one definition or the other?") but I think WaltP offered the best approach as it seems the OP was just looking for basic info...

*Edited 6 Years Ago by jonsca*: n/a

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Hello All ...

Iam Getting An Error With try to excecute the stored procedure .

I have Have Sql database , the stored procedure like so :

```
USE [MPRS]
GO
/****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE ...
```

Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"

Here is the sample output that I ...