[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

Please help

reepakmajhi.com@gmail.com

10/13/2008 4:32:00 PM

I am new to C++ Programming. So my question is Can we write a function
to use it in program?
6 Answers

Erik Wikström

10/13/2008 4:41:00 PM

0

On 2008-10-13 18:32, reepakmajhi.com@gmail.com wrote:
> I am new to C++ Programming. So my question is Can we write a function
> to use it in program?

Yes, see http://www.parashift.com/c++-faq-lite/how-to...

--
Erik Wikström

Victor Bazarov

10/13/2008 4:45:00 PM

0

reepakmajhi.com@gmail.com wrote:
> I am new to C++ Programming. So my question is Can we write a function
> to use it in program?

The answer is "yes, we usually can". If you need a more specific
answer, you should ask a more specific question.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Jeff Schwab

10/13/2008 4:47:00 PM

0

reepakmajhi.com@gmail.com wrote:
> I am new to C++ Programming. So my question is Can we write a function
> to use it in program?

Yes. Could you please be more specific about what you would like your
program to do? It will help if you can post a small example of the code
you have already tried.

chujiacheng

10/13/2008 9:24:00 PM

0

On Oct 13, 10:32 am, "reepakmajhi....@gmail.com"
<reepakmajhi....@gmail.com> wrote:
> I am new to C++ Programming. So my question is Can we write a function
> to use it in program?

This question is too general to give you a more specific answer. Can
you just give a specified example?

mlyon@mitrionics.com

10/14/2008 3:30:00 AM

0

On Oct 13, 2:24 pm, chujiacheng <chujiach...@gmail.com> wrote:
> On Oct 13, 10:32 am, "reepakmajhi....@gmail.com"
>
> <reepakmajhi....@gmail.com> wrote:
> > I am new to C++ Programming. So my question is Can we write a function
> > to use it in program?
>
> This question is too general to give you a more specific answer. Can
> you just give a specified example?

You could give them the generalized form of a function, especially
having it conform to standard good variable naming conventions, and
proper indenting. like GNU's "Hello World!"; that is, over-the-top-
example that definitely drives the point home. i'd do it myself but my
C++ elements of style book is 10 mi away on my desk!

Salt_Peter

10/14/2008 12:57:00 PM

0

On Oct 13, 11:30 pm, "ml...@mitrionics.com" <ml...@mitrionics.com>
wrote:
> On Oct 13, 2:24 pm, chujiacheng <chujiach...@gmail.com> wrote:
>
> > On Oct 13, 10:32 am, "reepakmajhi....@gmail.com"
>
> > <reepakmajhi....@gmail.com> wrote:
> > > I am new to C++ Programming. So my question is Can we write a function
> > > to use it in program?
>
> > This question is too general to give you a more specific answer. Can
> > you just give a specified example?
>
> You could give them the generalized form of a function, especially
> having it conform to standard good variable naming conventions, and
> proper indenting. like GNU's "Hello World!"; that is, over-the-top-
> example that definitely drives the point home. i'd do it myself but my
> C++ elements of style book is 10 mi away on my desk!

Then why didn't YOU provide a function example?
You need a style book to provide one? I'm puzzled.

To the OP:
both writing functions and types (struct, classes) is daily duty in C+
+.
You need a good book, which one will depend on what programming xp you
have so far.

If you really need an example:

#include <iostream>

void foo()
{
std::cout << "i'm a foo()\n";
}

int main()
{
foo();
}